/* ==========================================================
 * Diventa Volontario - Solivya
 * Palette: indigo #4c51bf | rosa #ef476f | giallo #ffd166
 *          verde #06d6a0 | viola #6b46c1 | teal #38b2ac
 * ========================================================== */

/* ===== HERO ===== */
.hero-volontari {
    position: relative;
    background:
        radial-gradient(ellipse at top left, rgba(255,209,102,0.18) 0%, transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(239,71,111,0.20) 0%, transparent 60%),
        linear-gradient(135deg, #4c51bf 0%, #6b46c1 55%, #ed8936 100%);
    color: #fff;
    padding: 110px 0 90px;
    text-align: center;
    overflow: hidden;
}

.hero-volontari::after {
    content: '';
    position: absolute;
    inset: auto 0 -1px 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #faf9fc);
    pointer-events: none;
}

.hero-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 22px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.hero-volontari h1 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.05;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}

.hero-volontari .hero-subtitle {
    font-size: 19px;
    max-width: 720px;
    margin: 0 auto 36px;
    opacity: 0.95;
    line-height: 1.65;
}

.hero-stats {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 16px 28px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 100px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.hero-stat {
    font-size: 14px;
    color: rgba(255,255,255,0.92);
    white-space: nowrap;
}

.hero-stat strong {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.hero-stat-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
}

/* ===== SECTION RUOLI ===== */
.section-ruoli {
    background: #faf9fc;
    padding: 90px 0;
}

.section-ruoli h2 {
    text-align: center;
    font-size: 38px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #1a202c;
    letter-spacing: -0.02em;
}

.section-intro {
    text-align: center;
    font-size: 17px;
    color: #64748b;
    max-width: 660px;
    margin: 0 auto 60px;
    line-height: 1.65;
}

.ruoli-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.ruolo-card {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 36px 30px 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 12px 30px -16px rgba(76,81,191,0.15);
    border: 1px solid #edeaf4;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ruolo-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, var(--accent-1, #4c51bf), var(--accent-2, #ef476f));
    opacity: 0.9;
}

.ruolo-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 24px 48px -20px rgba(76,81,191,0.28);
    border-color: #d8d3e6;
}

.ruolo-pari        { --accent-1: #4c51bf; --accent-2: #6b46c1; }
.ruolo-mentore     { --accent-1: #ef476f; --accent-2: #d6336c; }
.ruolo-amba        { --accent-1: #ed8936; --accent-2: #f5a623; }

.ruolo-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    margin-bottom: 18px;
    box-shadow: 0 6px 14px -6px var(--accent-1);
}

.ruolo-card h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a202c;
}

.ruolo-tagline {
    color: #475569;
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 20px;
    min-height: 46px;
}

.ruolo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.meta-pill {
    background: #f1eff8;
    color: #4c51bf;
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid #e6e1f3;
}

.meta-pill strong {
    color: #2d3157;
    font-weight: 700;
}

.ruolo-list {
    list-style: none;
    padding: 0;
    margin: 0 0 26px;
    flex: 1;
}

.ruolo-list li {
    position: relative;
    padding: 8px 0 8px 22px;
    font-size: 14.5px;
    color: #1a202c;
    line-height: 1.55;
    border-bottom: 1px solid #f3f0f8;
}

.ruolo-list li:last-child {
    border-bottom: none;
}

.ruolo-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-1);
}

.btn-ruolo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    background: #1a202c;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    font-family: inherit;
}

.btn-ruolo:hover {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    transform: translateY(-1px);
}

.btn-arrow {
    transition: transform 0.2s ease;
}

.btn-ruolo:hover .btn-arrow {
    transform: translateX(3px);
}

/* ===== SECTION FORM ===== */
.section-form {
    background: linear-gradient(180deg, #faf9fc 0%, #f1eef7 100%);
    padding: 80px 0;
}

.form-container {
    max-width: 880px;
    margin: 0 auto;
    background: #fff;
    border-radius: 24px;
    padding: 48px 44px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04), 0 32px 60px -32px rgba(76,81,191,0.22);
    border: 1px solid #ece8f5;
}

.form-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 11.5px;
    font-weight: 600;
    color: #ef476f;
    margin-bottom: 10px;
}

.form-container h2 {
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #1a202c;
    letter-spacing: -0.01em;
}

.form-container h2 #ruoloSelezionato {
    background: linear-gradient(135deg, #4c51bf, #ef476f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.form-lead {
    color: #64748b;
    font-size: 15px;
    line-height: 1.65;
    margin: 0 0 32px;
}

.form-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 32px;
    border-top: 1px solid #ece8f5;
    padding-top: 24px;
}

.form-fieldset:first-of-type {
    border-top: none;
    padding-top: 0;
}

.form-fieldset legend {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #4c51bf;
    margin-bottom: 18px;
    padding: 0;
    float: none;
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 6px;
}

.candidatura-form input[type="text"],
.candidatura-form input[type="email"],
.candidatura-form input[type="tel"],
.candidatura-form input[type="date"],
.candidatura-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2dfee;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #1a202c;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.candidatura-form input:focus,
.candidatura-form textarea:focus {
    outline: none;
    border-color: #4c51bf;
    background: #fafaff;
    box-shadow: 0 0 0 4px rgba(76,81,191,0.1);
}

.candidatura-form textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.55;
}

.form-hint {
    display: block;
    font-size: 12.5px;
    color: #64748b;
    margin-top: 5px;
}

.eta-info {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
}

.eta-info.success {
    background: #e6fffa;
    color: #0b6b5a;
    border: 1px solid #b8e8df;
}

.eta-info.error {
    background: #fff5f5;
    color: #9b2c2c;
    border: 1px solid #fed7d7;
}

.form-privacy {
    margin-top: 24px;
    padding: 14px 16px;
    background: #faf9fc;
    border-radius: 10px;
    border: 1px solid #ece8f5;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #1a202c;
    line-height: 1.55;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: #4c51bf;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label a {
    color: #4c51bf;
    font-weight: 600;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #ece8f5;
}

.btn-large {
    padding: 14px 28px;
    font-size: 15px;
}

.form-message {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14.5px;
    line-height: 1.55;
}

.form-message.success {
    background: #e6fffa;
    color: #0b6b5a;
    border: 1px solid #b8e8df;
}

.form-message.error {
    background: #fff5f5;
    color: #9b2c2c;
    border: 1px solid #fed7d7;
}

/* ===== FAQ ===== */
.section-faq-volontari {
    padding: 80px 0;
    background: #fff;
}

.section-faq-volontari h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 50px;
    color: #1a202c;
}

.section-faq-volontari .faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.section-faq-volontari .faq-item {
    background: #faf9fc;
    border-radius: 14px;
    padding: 24px 26px;
    border: 1px solid #ece8f5;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.section-faq-volontari .faq-item:hover {
    border-color: #4c51bf;
    transform: translateY(-2px);
}

.section-faq-volontari .faq-item h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a202c;
}

.section-faq-volontari .faq-item p {
    color: #475569;
    font-size: 14.5px;
    line-height: 1.6;
    margin: 0;
}

.section-faq-volontari .faq-item a {
    color: #ef476f;
    font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
    .ruoli-grid {
        grid-template-columns: 1fr;
        max-width: 540px;
        margin: 0 auto;
    }
    .section-faq-volontari .faq-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .hero-volontari {
        padding: 80px 0 60px;
    }
    .hero-volontari h1 { font-size: 38px; }
    .hero-volontari .hero-subtitle { font-size: 16px; }
    .hero-stats {
        gap: 14px;
        padding: 14px 20px;
        border-radius: 24px;
    }
    .hero-stat { font-size: 13px; }

    .section-ruoli, .section-form, .section-faq-volontari {
        padding: 60px 0;
    }
    .section-ruoli h2 { font-size: 30px; }

    .form-container {
        padding: 32px 22px;
        border-radius: 16px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-actions {
        flex-direction: column-reverse;
    }
    .form-actions .btn {
        width: 100%;
    }
}

/* Disponibilita oraria - checkbox fasce attive (Sessione 24) */
.fasce-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    min-height: 56px;
}
.fasce-checkbox-list .fascia-opt {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.fasce-checkbox-list .fascia-opt:hover {
    border-color: #c7d2fe;
    background: #eef2ff;
}
.fasce-checkbox-list .fascia-opt input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #4f46e5;
}
.fasce-checkbox-list .fascia-opt .fascia-info { flex: 1; line-height: 1.35; }
.fasce-checkbox-list .fascia-opt .fascia-info strong {
    display: block;
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
}
.fasce-checkbox-list .fascia-opt .fascia-info span {
    font-size: 12.5px;
    color: #6b7280;
}
.fasce-empty {
    grid-column: 1 / -1;
    margin: 0;
    color: #6b7280;
    font-size: 13.5px;
    text-align: center;
    padding: 8px;
}

/* ==========================================================
 * File Upload moderno (Sessione 26)
 * Sostituisce il classico input[type="file"] del browser
 * con una dropzone trascinabile coerente con lo stile del form.
 * ========================================================== */
.file-upload {
    position: relative;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Sessione 26 quinquies: rimosso !important da display:flex perche'
   impediva al JS di nascondere il dropzone quando si seleziona un file
   (il bottone X sembrava non funzionare perche' il dropzone restava visibile). */
.file-upload-dropzone {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 18px 18px;
    border: 2px dashed #c5cae9;
    border-radius: 14px;
    background: #fafaff;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .12s ease;
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    box-sizing: border-box;
    width: 100%;
}

/* Quando il container ha la classe .has-file, mostriamo SOLO la card
   selezionata e nascondiamo il dropzone. Approccio piu' robusto del
   semplice style.display inline che certi UA estendono in modi strani. */
.file-upload.has-file .file-upload-dropzone { display: none; }

.file-upload-dropzone:hover {
    border-color: #4c51bf;
    background: #f3f3ff;
    transform: translateY(-1px);
}

.file-upload.is-dragover .file-upload-dropzone {
    border-style: solid;
    border-color: #6b46c1;
    background: #efeaff;
    transform: translateY(-1px);
}

.file-upload-icon {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4c51bf, #6b46c1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(76, 81, 191, 0.25);
}

.file-upload-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.file-upload-cta {
    color: #1a202c;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.file-upload-sub {
    color: #6b7280;
    font-size: 13px;
}

.file-upload-selected {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(6, 214, 160, 0.10), rgba(76, 81, 191, 0.08));
    border: 1px solid rgba(6, 214, 160, 0.35);
    color: #065f46;
    font-size: 14px;
    font-weight: 500;
    box-sizing: border-box;
}

.file-upload-selected::before {
    content: '';
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #06d6a0
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>")
        center / 12px no-repeat;
}

.file-upload-selected-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #134e4a;
}

.file-upload-remove {
    appearance: none;
    border: none;
    background: rgba(220, 38, 38, 0.10);
    color: #b91c1c;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
    flex: 0 0 26px;
}
.file-upload-remove:hover {
    background: rgba(220, 38, 38, 0.18);
}

@media (max-width: 600px) {
    .file-upload-dropzone {
        flex-direction: column;
        text-align: center;
        padding: 22px 16px;
    }
    .file-upload-text { align-items: center; }
}
