/* ======================================
   GLOBAL STYLE
====================================== */
body {
    margin: 0;
    background: #212122;
    color: #b4b2a1;
    font-family: "Menlo", "Menlo", monospace;
    font-size: 17px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}


html {
    font-size: clamp(14px, 2.2vw, 18px); 
}
 /* Aumenta leggermente la dimensione del testo su telefoni grandi */
@media (min-width: 390px) {
    html {
        font-size: 16px; /* leggero aumento */
    }
}

@media (min-width: 430px) {
    html {
        font-size: 17px; /* iPhone 14/15/16/17 Pro Max */
    }
}

/* ======================================
   PROGRESS BAR
====================================== */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.15);
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: #b4b2a1;
    transition: width 0.25s ease;
}

/* ======================================
   MAIN CONTAINER
====================================== */
.container {
    margin-top: 40px;
    width: 100%;
    max-width: 620px;
    padding: 25px;
    text-align: center;
}


/* ======================================
   LANGUAGE SELECTOR (INTRO ONLY)
====================================== */
#language-selector {
    text-align: center;
    margin-bottom: 40px;
}

.lang-label {
    font-size: 14px;
    opacity: 0.6;
    margin-bottom: 5px;
}

.lang-option {
    font-size: 16px;
    cursor: pointer;
    color: #5a5c5e;
    padding: 0 6px;
    transition: opacity 0.2s ease;
}

.lang-option:hover {
    opacity: 0.5;
}

.lang-separator {
    opacity: 0.4;
    padding: 0 5px;
}

/* ======================================
   LOGO
====================================== */
.logo {
    width: 180px;
    margin: 0 auto 25px auto;
    display: block;
}

/* ======================================
   QUESTION INDEX
====================================== */
#arrow-index {
    font-size: 19px;
    opacity: 0.8;
    margin-bottom: 30px;
    margin-top: 50px;                          /* ALZARE E ABBASSARE IL NUMERO */ 
     color: #5a5c5e;
}

/* ======================================
   INTRO TEXT
====================================== */
.intro-text {
    font-size: 17px;
    line-height: 26px;
    max-width: 340px;
    margin: 0 auto 22px auto;
    text-align: center;
    margin-top: 10px;
}

.minutes-note {
    margin-top: 12px;
    font-size: 13px;
    opacity: 0.55;
    color: #5a5c5e;
}


/* ======================================
   OPTIONS
====================================== */
.options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
   
}



.opt-label {
    font-size: 12px;
    background: #3a3a3c;
    color: #b4b2a1;
    border: 1px solid #b4b2a1;
    padding: 3px 7px;
    border-radius: 4px;
}

.opt-text {
    width: 100%;
    font-size: 15px;
    line-height: 18px;
}

.box-option {
    width: 300px;
    padding: 10px 12px;
    border: 1px solid #b4b2a1;
    border-radius: 6px;

    display: grid;
    grid-template-columns: 40px 1fr 40px;  /* 🔹 stessa dimensione originale */
    column-gap: 10px;                      /* 🔹 spazio aggiunto tra lettera e testo */
    align-items: center;

    background: transparent;
    color: #b4b2a1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.opt-text {
    font-size: 15px;
    line-height: 20px;   /* 🔹 migliora le risposte su 2–3 righe */
}

.box-option:hover {
    background: rgba(255,255,255,0.08);
}

.box-option.selected {
    background: #b4b2a1;
    color: #212122;
    font-weight: bold;
}

.box-option.selected .opt-label {
    background: #b4b2a1;
    color: #212122;
    border-color: #212122;
}

.box-option input { display: none; }


/* ======================================
   MULTIPLE SELECT INFO
====================================== */
.limit-info {
    margin-top: 6px;
    font-size: 13px;
    opacity: 0.65;
}

/* ======================================
   OTHER TEXTAREA (Special case)
====================================== */
#female_priorities_other {
    width: 300px;
    max-width: 100%;
    margin: 12px auto 0 auto;
    padding: 10px;
    font-size: 15px;
    background: transparent;
    border: 1px solid #b4b2a1;
    color: #b4b2a1;
    border-radius: 4px;
    text-align: left;
}

#female_priorities_other::placeholder {
    opacity: 0.6;
}

/* ======================================
   BUTTONS
====================================== */

button {
    background: #b4b2a1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    -webkit-appearance: none !important;
    appearance: none !important;
}

button:hover {
    opacity: 0.75;
}

/* FINAL BUTTON */
.send-btn {
    width: 200px;
    margin: 0 auto;
    padding: 12px 20px;
    font-size: 17px;
}

/* ======================================
   FINAL SCREEN
====================================== */
.final-message {
    display: none;
    margin-top: 30px;
}

.final-input,
.final-textarea {
    width: 86%;
    padding: 12px;
    margin: 12px auto;
    background: transparent;
    border: 1px solid #b4b2a1;
    color: #b4b2a1;
    border-radius: 6px;
}

.final-textarea {
    height: 120px;
}

/* ======================================
   ALERT
====================================== */
#custom-alert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    display: flex;
    justify-content: center;
    align-items: center;
}

.alert-hidden {
    display: none !important;
}

.alert-box {
    background: #b4b2a1;
    color: #212122;
    padding: 26px 32px;
    border-radius: 8px;
    max-width: 320px;
    text-align: center;
}

/* ======================================
   START BUTTON
====================================== */
.start-button {
    width: 170px !important;          /* identico a OK */
    padding: 12px 18px !important;    /* identico a OK */
    font-size: 17px !important;       /* identico a OK */
    background: #b4b2a1 !important;
    color: #212122 !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    margin: 40px auto 0 auto !important; 
    display: inline-block !important;
    transition: opacity 0.2s ease !important;
}


.start-button:hover {
    opacity: 0.75;
}


/* Evita che il testo spinga il resto */
#intro .intro-text {
    flex-shrink: 0;
}


/* Struttura intro identica alle domande */
#intro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 415px;      /* identico alle domande */
    padding-bottom: 30px;
}

/* Il blocco testo resta compatto */
.intro-text-block {
    flex-shrink: 0;
}

/* Mantieni il bottone in basso */
#start-btn {
    align-self: center;
}

/* La nota 3–5 minutes deve stare più in basso e NON influenzare il layout */
#minutes-note {
    margin-top: -15px;
}


.logo-wrapper {
    position: relative;
    width: 80px;              /* scala logo */
    margin: -15px auto 25px auto;
}

.logo-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* BACK BUTTON */
#back-btn {
    position: absolute;
    top: calc(100% + 43px);               /* ALZARE E ABBASSARE FRECCIA */ 
    left: 3%;
    transform: translateX(-55%);
    font-size: 24px;
    color: #5a5c5e;;
    cursor: pointer;
    display: none;
    user-select: none;
    transition: opacity 0.2s ease; /* 👈 smooth */
}


#back-btn:hover {
    opacity: 0.6;
}


/* ======================================
   QUESTION — FINAL, STABLE, RESPONSIVE
====================================== */

.question {
    min-height: calc(100vh - 200px);
    display: grid;
    grid-template-rows: auto 1fr auto;
}

/* DOMANDA */
.question h2 {
    margin: 0 auto 24px auto;
    max-width: 480px;
    text-align: center;
}

/* BLOCCO CENTRALE (opzioni + textarea + limit) */
.question-middle {
    display: flex;
    flex-direction: column;
    justify-content: center;   /* 🎯 centro vero */
    align-items: center;
    gap: 12px;
    padding-top: 20px;         /* alza tutto */
}

/* OPZIONI */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* LIMIT INFO */
.limit-info {
    font-size: 13px;
    opacity: 0.65;
    text-align: center;
}

/* OTHER TEXTAREA */
#female_priorities_other {
    width: 300px;
    margin-top: 10px;
    align-self: center;
}

/* OK BUTTON — SEMPRE VISIBILE */
.question button {
    margin: 30px auto 0 auto;
    width: 170px;
    padding: 12px 18px;
    font-size: 17px;
}



/* ======================================
   FINAL SCREEN — STABLE ALL DEVICES
====================================== */

#final {
    display: none;
    text-align: center;
    padding-bottom: 80px;
}

#final h2 {
    font-size: 26px;
    margin-top: 50px;                   /* ABBASSA THANK YOU */
    margin-bottom: 14px;
}

#final .divider {
    margin-top: 70px;               /* stacco optional question */
    margin-bottom: 24px;
    font-size: 16px;
    opacity: 0.8;
    white-space: nowrap;   /* 🔥 NON va a capo */
}


#final .final-description {
    max-width: 420px;
    margin: 0 auto 28px auto;
    line-height: 28px;
    font-size: 17px;
}

.final-input,
.final-textarea {
    width: 90%;
    max-width: 420px;
    margin: 0 auto 14px auto;
    padding: 14px;
    font-size: 17px;
}

/* MOBILE */
@media (max-width: 520px) {

    #final h2 {
        font-size: 22px;
        margin-top: 60px;                       /* stacco THANK YOU */
    }

    #final .divider {
        margin-top: 80px;                     /* stacco optional question */
        margin-bottom: 28px;
        font-size: 15px;
    }

    #final .final-description {
        font-size: 16px;
        line-height: 26px;
    }

    .final-input,
    .final-textarea {
        width: 92%;
        font-size: 16px;
        padding: 12px;
    }
}

 /* SCHERMI PICCOLI */

@media (max-width: 380px) {
    #final .divider {
        font-size: 14.5px;   /* leggermente più piccolo */
        letter-spacing: 0.2px;
    }
}


/* ===== iOS Safari FIX — force button style ===== */
button,
button:focus,
button:active {
    -webkit-appearance: none !important;
    appearance: none !important;
    background-color: #b4b2a1 !important;
    color: #212122 !important;
    outline: none !important;
    border-radius: 4px;
}

button::-webkit-focus-inner {
    border: 0;
}


/* ======================================
   RESTART BUTTON — FINAL OVERRIDE
====================================== */
#restart-btn {
    width: 170px !important;
    padding: 12px 18px !important;
    font-size: 17px !important;

    background: #b4b2a1 !important;
    color: #212122 !important;

    border: none !important;
    border-radius: 4px !important;

    cursor: pointer !important;
    display: block !important;
    margin: 40px auto 0 auto !important;

    font-weight: bold !important;
    transition: opacity 0.2s ease !important;
}

#restart-btn:hover {
    opacity: 0.75 !important;
}


#back-btn {
    pointer-events: auto;
    z-index: 9999;
}
.logo-svg {
    pointer-events: none;
}


/* ======================================
   QUESTION — FINAL, STABLE, RESPONSIVE
====================================== */

.question {
    min-height: calc(100vh - 400px);
    display: grid;
    grid-template-rows: auto 1fr auto;
}

/* DOMANDA */
.question h2 {
    margin: 0 auto 24px auto;
    max-width: 480px;
    text-align: center;
}

/* BLOCCO CENTRALE (opzioni + textarea + limit) */
.question-middle {
    display: flex;
    flex-direction: column;
    justify-content: center;   /* 🎯 centro vero */
    align-items: center;
    gap: 12px;
    padding-top: 20px;         /* alza tutto */
}

/* OPZIONI */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* LIMIT INFO */
.limit-info {
    font-size: 13px;
    opacity: 0.65;
    text-align: center;
}

/* OTHER TEXTAREA */
#female_priorities_other {
    width: 300px;
    margin-top: 10px;
    align-self: center;
}

/* OK BUTTON — SEMPRE VISIBILE */
.question button {
    margin: 30px auto 0 auto;
    width: 170px;
    padding: 12px 18px;
    font-size: 17px;
}



/* ======================================
   QUESTION — FINAL RESPONSIVE (ALL SCREENS)
====================================== */

.question {
    min-height: calc(100vh - 400px); /* stabile su desktop */
    display: grid;
    grid-template-rows: auto 1fr auto;
}

/* DOMANDA */
.question h2 {
    margin: 0 auto 22px auto;
    max-width: 480px;
    text-align: center;

    font-size: 18px;      /* 👈 dimensione domanda */
    line-height: 30px;    /* 👈 leggibilità */
    font-weight: 500;     /* 👈 elegante, non troppo bold */
}

/* BLOCCO CENTRALE */
.question-middle {
    display: flex;
    flex-direction: column;
    justify-content: center;   /* 🎯 centro matematico */
    align-items: center;
    gap: 12px;
}

/* OPZIONI */
.options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* LIMIT INFO */
.limit-info {
    font-size: 13px;
    opacity: 0.65;
    text-align: center;
}

/* OTHER TEXTAREA */
#female_priorities_other {
    width: 300px;
    margin-top: 10px;
    align-self: center;
}

/* OK BUTTON */
.question button {
    margin: 26px auto 0 auto;
    width: 170px;
    padding: 12px 18px;
    font-size: 17px;
}

/* ======================================
   MOBILE ADJUSTMENT (NO LAYOUT CHANGE)
====================================== */
@media (max-width: 520px) {

    .question {
        min-height: calc(100vh - 350px); /* più spazio utile */
    }

    .question h2 {
        margin-bottom: 18px;
        font-size: 1.05rem;
    }

    .question-middle {
        gap: 10px; /* più compatto */
    }

    .question button {
        margin-top: 22px;
    }
}
