.amrc-form-container {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    font-family: sans-serif;
}
.amrc-form-container fieldset {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}
.amrc-form-container legend {
    font-weight: bold;
    padding: 0 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
}
.amrc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
@media (max-width: 768px) {
    .amrc-grid { grid-template-columns: 1fr; }
}
.amrc-form-container label {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    font-weight: 600;
}
.amrc-form-container input[type="text"],
.amrc-form-container input[type="email"],
.amrc-form-container input[type="date"],
.amrc-form-container input[type="number"],
.amrc-form-container select,
.amrc-form-container input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.brano-finale {
    background: #fafafa;
    padding: 15px;
    border: 1px dashed #bbb;
    margin-bottom: 15px;
}
.amrc-dichiarazione-box {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    padding: 18px 20px;
    margin: 20px 0;
}

.amrc-dichiarazione-text {
    font-size: 13px;
    line-height: 1.7;
    color: #444;
    margin: 0 0 14px 0;
    text-align: justify;
}

.amrc-dichiarazione-text a {
    color: #0073aa;
    word-break: break-all;
}

.amrc-dichiarazione-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
    margin: 0;
}

.amrc-dichiarazione-check input[type="checkbox"] {
    margin: 2px 0 0 0;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.amrc-data-security-note {
    margin: 14px 0 12px;
    padding: 10px 12px;
    border-radius: 4px;
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    color: #24496b;
    font-size: 13px;
    line-height: 1.6;
}

.amrc-allegati-intro {
    font-weight: 600;
    margin-bottom: 16px;
    color: #1d2327;
}

.amrc-allegato-item {
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.amrc-allegato-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d2327;
}

.amrc-allegato-item input[type="file"] {
    display: block;
    width: 100%;
}

.amrc-field-hint {
    font-size: 12px;
    color: #646970;
    margin: 6px 0 0 0;
}

.amrc-optional {
    font-weight: 400;
    color: #646970;
    font-size: 13px;
}

.amrc-gdpr-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #1d2327;
    margin: 10px 0 0 0;
}

.amrc-gdpr-check input[type="checkbox"] {
    margin: 2px 0 0 0;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.amrc-gdpr-check a {
    color: #0073aa;
}

.amrc-submit-btn {
    width: 100%;
    background: #0073aa;
    color: #fff;
    font-size: 16px;
    padding: 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    font-weight: bold;
}
.amrc-submit-btn:disabled {
    background: #777;
    cursor: not-allowed;
}

.amrc-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99999;
    overflow-y: auto;
    padding: 24px 16px;
    box-sizing: border-box;
}

.amrc-popup-overlay.amrc-popup-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.amrc-popup-inner {
    position: relative;
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 860px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.28);
    animation: amrcPopupIn 0.22s ease;
}

@keyframes amrcPopupIn {
    from { opacity: 0; transform: translateY(-18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.amrc-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #444;
    cursor: pointer;
    z-index: 10;
    padding: 0 4px;
    transition: color 0.15s;
}

.amrc-popup-close:hover {
    color: #b32d2e;
}

.amrc-popup-scroll {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 8px 0;
    border-radius: 10px;
}

.amrc-in-popup {
    box-shadow: none;
    border-radius: 0;
}

body.amrc-popup-body-locked {
    overflow: hidden;
}

/* =========================================================
   PROGRESSO UPLOAD — overlay centrato sul form
========================================================= */
.amrc-form-container {
    position: relative;
}

.amrc-progress-wrap {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(3px);
    border-radius: 8px;
    padding: 32px 24px;
    text-align: center;
    gap: 0;
}

.amrc-progress-label {
    font-size: 15px;
    color: #1a1a1a;
    margin: 14px 0 16px;
    font-weight: 600;
    line-height: 1.4;
}

.amrc-progress-bar-track {
    background: #e0e7ef;
    border-radius: 50px;
    height: 10px;
    overflow: hidden;
    width: 100%;
    max-width: 360px;
    margin-bottom: 8px;
}

.amrc-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1a73e8, #0d5ab8);
    border-radius: 50px;
    transition: width 0.3s ease;
}

.amrc-progress-pct {
    font-size: 13px;
    color: #555;
    margin: 0;
    font-weight: 600;
}

.amrc-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #dce3ec;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: amrcSpin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes amrcSpin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   ESITO SUCCESSO — messaggio dentro il form (sostituisce il form)
========================================================= */
.amrc-success-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 32px;
    gap: 0;
    animation: amrcPopupIn 0.3s ease;
}

.amrc-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #2e7d32;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 36px;
    color: #fff;
    font-weight: bold;
    flex-shrink: 0;
}

.amrc-success-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px;
}

.amrc-success-message {
    font-size: 15px;
    color: #555;
    line-height: 1.7;
    max-width: 480px;
    margin: 0;
}

/* =========================================================
   MODALE ESITO
========================================================= */
.amrc-result-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.amrc-result-modal-overlay.amrc-result-open {
    display: flex;
}

.amrc-result-modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px 28px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0,0,0,0.22);
    animation: amrcPopupIn 0.2s ease;
}

.amrc-result-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    margin: 0 auto 16px;
    color: #fff;
}

.amrc-result-success .amrc-result-icon {
    background: #2e7d32;
}

.amrc-result-error .amrc-result-icon {
    background: #b32d2e;
}

.amrc-result-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1a1a1a;
}

.amrc-result-message {
    font-size: 15px;
    color: #555;
    margin: 0 0 24px;
    line-height: 1.6;
}

.amrc-result-success .amrc-result-close {
    background: #2e7d32;
}

.amrc-result-error .amrc-result-close {
    background: #b32d2e;
}

.amrc-result-close {
    width: auto;
    padding: 10px 32px;
    font-size: 15px;
    margin-top: 0;
}

/* =========================================================
   FORM SOLISTI — radio inline
========================================================= */
.amrc-radio-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.amrc-radio-inline .amrc-check-inline input[type="radio"] {
    width: 16px;
    height: 16px;
}

.amrc-chiede-di > label:first-child {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    display: block;
}

/* =========================================================
   FORM GRUPPI — stili specifici
========================================================= */
.amrc-fieldset-intro {
    font-size: 13px;
    color: #555;
    margin: 0 0 14px;
    line-height: 1.6;
}

.amrc-grid-2 {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 600px) {
    .amrc-grid-2 { grid-template-columns: 1fr; }
}

.amrc-componenti-section {
    margin-top: 20px;
}

.amrc-componenti-section h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1d2327;
}

.amrc-componenti-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 10px;
}

.amrc-componenti-table thead tr {
    background: #f0f4f8;
}

.amrc-componenti-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    color: #1d2327;
    border: 1px solid #ddd;
    white-space: nowrap;
}

.amrc-componenti-table td {
    padding: 5px 6px;
    border: 1px solid #e2e4e7;
    vertical-align: middle;
}

.amrc-componenti-table .amrc-comp-num {
    width: 34px;
    text-align: center;
    font-weight: 700;
    color: #646970;
}

.amrc-componenti-table input[type="text"],
.amrc-componenti-table input[type="date"] {
    margin: 0;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
}

.amrc-componenti-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.amrc-brano-section {
    margin-bottom: 20px;
}

.amrc-brano-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e4e7;
}

.amrc-brano-eliminatoria {
    background: #f0f6fb;
    border: 1px solid #c8dff0;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.amrc-brano-finale-card {
    background: #fafafa;
    border: 1px dashed #bbb;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.brano-finale-header {
    font-size: 13px;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.amrc-esecuzione-checks {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.amrc-esecuzione-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.amrc-check-inline {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
    font-size: 13px;
    color: #333;
    margin: 0;
}

.amrc-check-inline input[type="checkbox"] {
    margin: 2px 0 0 0;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.amrc-dettaglio-esecuzione {
    margin-top: 0 !important;
    margin-left: 23px;
    font-size: 13px;
}

.amrc-bonifico-info {
    line-height: 2;
    padding: 14px 18px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* =========================================================
   TEMA CONTEST — attivato con class="amrc-theme-contest"
   nello shortcode: [amrc_form_solisti class="amrc-theme-contest"]
========================================================= */

:root {
    --amrc-orange:       #F5600A;
    --amrc-orange-dark:  #d44e00;
    --amrc-orange-light: #fff3ed;
    --amrc-dark:         #1a1a1a;
    --amrc-mid:          #444444;
    --amrc-gray:         #6b7280;
    --amrc-border:       #e5e7eb;
    --amrc-bg:           #f9fafb;
    --amrc-white:        #ffffff;
    --amrc-radius:       10px;
    --amrc-radius-sm:    6px;
    --amrc-shadow:       0 4px 24px rgba(0,0,0,0.08);
}

.amrc-theme-contest {
    background: var(--amrc-white);
    border-radius: var(--amrc-radius);
    box-shadow: var(--amrc-shadow);
    padding: 36px 40px;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    color: var(--amrc-dark);
    border: 1px solid var(--amrc-border);
}

@media (max-width: 640px) {
    .amrc-theme-contest {
        padding: 24px 18px;
    }
}

.amrc-theme-contest h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--amrc-dark);
    margin: 0 0 28px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--amrc-orange);
    letter-spacing: -0.01em;
}

/* --- FIELDSET --- */
.amrc-theme-contest fieldset {
    border: 1.5px solid var(--amrc-border);
    border-radius: var(--amrc-radius);
    padding: 24px 24px 20px;
    margin-bottom: 24px;
    background: var(--amrc-white);
    transition: border-color 0.2s;
}

.amrc-theme-contest fieldset:focus-within {
    border-color: var(--amrc-orange);
}

.amrc-theme-contest legend {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--amrc-orange);
    background: var(--amrc-white);
    border: none;
    padding: 0 10px;
    border-radius: 0;
}

/* --- LABELS --- */
.amrc-theme-contest label {
    font-size: 12px;
    font-weight: 600;
    color: var(--amrc-mid);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 14px;
}

/* --- INPUTS --- */
.amrc-theme-contest input[type="text"],
.amrc-theme-contest input[type="email"],
.amrc-theme-contest input[type="date"],
.amrc-theme-contest input[type="number"],
.amrc-theme-contest select {
    width: 100%;
    padding: 11px 14px;
    margin-top: 6px;
    border: 1.5px solid var(--amrc-border);
    border-radius: var(--amrc-radius-sm);
    font-size: 14px;
    color: var(--amrc-dark);
    background: var(--amrc-white);
    box-sizing: border-box;
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
    -webkit-appearance: none;
}

.amrc-theme-contest input[type="text"]:focus,
.amrc-theme-contest input[type="email"]:focus,
.amrc-theme-contest input[type="date"]:focus,
.amrc-theme-contest input[type="number"]:focus,
.amrc-theme-contest select:focus {
    border-color: var(--amrc-orange);
    box-shadow: 0 0 0 3px rgba(245,96,10,0.12);
}

.amrc-theme-contest input[type="file"] {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1.5px dashed var(--amrc-border);
    border-radius: var(--amrc-radius-sm);
    font-size: 13px;
    color: var(--amrc-gray);
    background: var(--amrc-bg);
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.18s;
}

.amrc-theme-contest input[type="file"]:hover {
    border-color: var(--amrc-orange);
}

/* --- GRID --- */
.amrc-theme-contest .amrc-grid {
    gap: 12px 20px;
}

/* --- CANDIDATO BOX --- */
.amrc-theme-contest #dati_candidato {
    background: var(--amrc-orange-light);
    border: 1.5px solid #f5c6a0;
    border-radius: var(--amrc-radius-sm);
}

/* --- DICHIARAZIONE BOX --- */
.amrc-theme-contest .amrc-dichiarazione-box {
    background: var(--amrc-bg);
    border: 1.5px solid var(--amrc-border);
    border-left: 4px solid var(--amrc-orange);
    border-radius: var(--amrc-radius-sm);
    padding: 20px 22px;
    margin: 24px 0;
}

.amrc-theme-contest .amrc-dichiarazione-text {
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--amrc-gray);
}

.amrc-theme-contest .amrc-dichiarazione-text a {
    color: var(--amrc-orange);
    text-decoration: underline;
}

.amrc-theme-contest .amrc-dichiarazione-check {
    font-size: 13px;
    font-weight: 600;
    color: var(--amrc-dark);
    gap: 10px;
}

.amrc-theme-contest .amrc-data-security-note {
    background: #fff7ef;
    border: 1.5px solid #f5c6a0;
    color: var(--amrc-mid);
    border-radius: var(--amrc-radius-sm);
}

/* --- CHECKBOX CUSTOM --- */
.amrc-theme-contest .amrc-dichiarazione-check input[type="checkbox"],
.amrc-theme-contest .amrc-gdpr-check input[type="checkbox"],
.amrc-theme-contest .amrc-check-inline input[type="checkbox"],
.amrc-theme-contest .amrc-check-inline input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--amrc-orange);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
}

/* --- GDPR CHECK --- */
.amrc-theme-contest .amrc-gdpr-check {
    font-size: 13px;
    color: var(--amrc-mid);
    margin: 14px 0 0;
    gap: 10px;
    padding: 14px 16px;
    background: var(--amrc-orange-light);
    border-radius: var(--amrc-radius-sm);
    border: 1.5px solid #f5c6a0;
}

.amrc-theme-contest .amrc-gdpr-check a {
    color: var(--amrc-orange);
    text-decoration: underline;
    font-weight: 600;
}

/* --- ALLEGATI --- */
.amrc-theme-contest .amrc-allegato-item {
    background: var(--amrc-bg);
    border: 1.5px solid var(--amrc-border);
    border-radius: var(--amrc-radius-sm);
}

.amrc-theme-contest .amrc-allegato-item label {
    font-size: 12px;
    color: var(--amrc-mid);
}

.amrc-theme-contest .amrc-field-hint {
    font-size: 11.5px;
    color: var(--amrc-gray);
    margin-top: 5px;
}

/* --- BRANI --- */
.amrc-theme-contest .amrc-brano-eliminatoria {
    background: var(--amrc-orange-light);
    border-color: #f5c6a0;
}

.amrc-theme-contest .brano-finale,
.amrc-theme-contest .amrc-brano-finale-card {
    background: var(--amrc-bg);
    border: 1.5px dashed var(--amrc-border);
    border-radius: var(--amrc-radius-sm);
}

.amrc-theme-contest .brano-finale-header {
    color: var(--amrc-orange);
}

/* --- COMPONENTI TABLE --- */
.amrc-theme-contest .amrc-componenti-table thead tr {
    background: var(--amrc-orange-light);
}

.amrc-theme-contest .amrc-componenti-table th {
    color: var(--amrc-orange-dark);
    border-color: #f5c6a0;
}

.amrc-theme-contest .amrc-componenti-table td {
    border-color: var(--amrc-border);
}

.amrc-theme-contest .amrc-componenti-table tbody tr:nth-child(even) {
    background: #fdf6f1;
}

/* --- FIELDSET INTRO --- */
.amrc-theme-contest .amrc-fieldset-intro {
    font-size: 13px;
    color: var(--amrc-gray);
    line-height: 1.6;
}

/* --- PULSANTE SUBMIT --- */
.amrc-theme-contest .amrc-submit-btn {
    background: var(--amrc-orange);
    color: var(--amrc-white);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 16px 24px;
    border: none;
    border-radius: var(--amrc-radius-sm);
    cursor: pointer;
    width: 100%;
    margin-top: 24px;
    transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
    box-shadow: 0 4px 14px rgba(245,96,10,0.25);
}

.amrc-theme-contest .amrc-submit-btn:hover {
    background: var(--amrc-orange-dark);
    box-shadow: 0 6px 20px rgba(245,96,10,0.35);
    transform: translateY(-1px);
}

.amrc-theme-contest .amrc-submit-btn:active {
    transform: translateY(0);
}

.amrc-theme-contest .amrc-submit-btn:disabled {
    background: #ccc;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}
