/* ==========================================================================
   JOY — portal do ministério de jovens da Igreja Presbiteriana Nova Canaã
   Mobile-first. Tema escuro; o verde é destaque, nunca fundo de tela.
   ========================================================================== */

:root {
    --bg: #0a0c0b;
    --bg-raised: #0e1110;
    --card: #131715;
    --card-hover: #181d1a;
    --line: #242a27;
    --line-strong: #353d39;

    --text: #f3f5f4;
    --muted: #aab3ae;      /* 8,9:1 sobre --bg */
    --subtle: #87918c;     /* 5,6:1 sobre --bg — só texto secundário */

    /* Verde oficial da logo do JOY. */
    --green: #1ed760;
    --green-hover: #4be283;
    --green-ink: #03150b;  /* texto sobre botão verde, 11:1 */
    --green-soft: rgba(30, 215, 96, .10);
    --green-line: rgba(30, 215, 96, .45);

    --danger: #ff8f85;
    --danger-soft: rgba(255, 143, 133, .10);

    --radius-lg: 22px;
    --radius: 16px;
    --radius-sm: 12px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Foco e rolagem automática param ACIMA da barra fixa do celular. */
    scroll-padding-bottom: 7rem;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 3px;
    border-radius: 6px;
}

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 50;
    padding: .75rem 1rem;
    background: var(--green);
    color: var(--green-ink);
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* Brilho verde discreto no topo: dá profundidade sem pintar a tela. */
.glow {
    position: fixed;
    inset: -30vh -20vw auto;
    height: 70vh;
    background: radial-gradient(closest-side, rgba(30, 215, 96, .12), transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* --------------------------------------------------------------- topo -- */

.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    border-radius: 8px;
}

.brand__logo { height: 52px; width: auto; }
/* Na landing a logo acompanha a largura (proporção 3,35:1): ocupa o espaço
   do celular sem estourar e para de crescer no desktop. */
.brand__logo--lg { width: min(100%, 23rem); height: auto; }

.brand__tag {
    font-size: .6875rem;
    line-height: 1.25;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--green);
    font-weight: 600;
}


/* ------------------------------------------------------------ botões -- */

.btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    min-height: 52px;
    padding: .9rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s var(--ease), border-color .2s var(--ease),
                color .2s var(--ease), transform .15s var(--ease), opacity .2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { cursor: progress; opacity: .75; transform: none; }

.btn--primary { background: var(--green); color: var(--green-ink); }
.btn--primary:hover { background: var(--green-hover); }

.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--muted); background: rgba(255, 255, 255, .03); }

.btn--cta {
    width: 100%;
    min-height: 60px;
    font-size: 1rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    box-shadow: 0 10px 40px -12px rgba(30, 215, 96, .55);
}

.btn__arrow { transition: transform .2s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

.spinner {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ landing -- */

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Alinhado pelo topo, e não centralizado: com o conteúdo mais alto que a
       janela, o center do flex empurra o excesso para CIMA e corta a logo. */
    justify-content: flex-start;
    padding-top: clamp(1.5rem, 7vh, 4.5rem);
    padding-bottom: 3rem;
}

.hero__logo { display: flex; justify-content: center; margin-bottom: 2.5rem; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 1rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--green);
}
.eyebrow::before {
    content: "";
    width: 18px; height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.hero__title {
    margin: 0 0 1.5rem;
    font-size: clamp(2rem, 8.2vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -.03em;
    font-weight: 800;
    text-wrap: balance;
}
.hero__title em { font-style: normal; color: var(--green); }

.hero__text p {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 1.0625rem;
    max-width: 38rem;
}
.hero__text p strong { color: var(--text); font-weight: 600; }

.hero__actions { margin-top: 2rem; }

.hero__note {
    margin: 1rem 0 0;
    font-size: .9375rem;
    color: var(--subtle);
    text-align: center;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
}
.chips li {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .8125rem;
    color: var(--muted);
    background: var(--bg-raised);
}
.chips svg { width: 15px; height: 15px; color: var(--green); }

.footer {
    position: relative;
    z-index: 1;
    padding: 1.75rem 0 2rem;
    border-top: 1px solid var(--line);
    font-size: .8125rem;
    color: var(--subtle);
}
.footer a { color: var(--muted); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.footer a:hover { color: var(--text); }

/* Entrada da landing: sobe e aparece, em sequência curta. */
.reveal { animation: reveal .7s var(--ease) both; }
.reveal--1 { animation-delay: .05s; }
.reveal--2 { animation-delay: .15s; }
.reveal--3 { animation-delay: .25s; }
.reveal--4 { animation-delay: .35s; }
@keyframes reveal {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------- questionário -- */

.survey-head { padding-top: .25rem; padding-bottom: 1.25rem; }

.survey-head__title {
    margin: 0 0 1.1rem;
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: -.02em;
    font-weight: 800;
}

.progress {
    display: flex;
    align-items: center;
    gap: .9rem;
}
.progress__label {
    flex: none;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    min-width: 3.5rem;
}
.progress__track {
    flex: 1;
    height: 6px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}
.progress__bar {
    height: 100%;
    width: 0;
    background: var(--green);
    border-radius: inherit;
    transition: width .45s var(--ease);
}

/* z-index: auto DE PROPÓSITO, anulando o do .shell: um z-index no <main> cria
   contexto de empilhamento, e a barra fixa (z-index 10) passava a perder para o
   rodapé — com a página rolada até o fim, o rodapé cobria o botão Continuar. */
.survey { position: relative; z-index: auto; flex: 1; padding-bottom: 7.5rem; }

.step { animation: step-in .38s var(--ease) both; }
.step.is-back { animation-name: step-in-back; }
@keyframes step-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes step-in-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

/* Sem JS as etapas ficam empilhadas e o formulário continua enviável. */
.js .step:not(.is-active) { display: none; }
.no-js-only { display: block; }
.js .no-js-only { display: none; }

.step__title {
    margin: 0 0 .5rem;
    font-size: 1.5rem;
    line-height: 1.25;
    letter-spacing: -.02em;
    font-weight: 800;
    text-wrap: balance;
}
.step__title:focus { outline: none; }
.step__lead { margin: 0 0 1.75rem; color: var(--muted); }

.note {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    margin: 0 0 1.75rem;
    padding: .9rem 1rem;
    border: 1px solid var(--green-line);
    background: var(--green-soft);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .9375rem;
    line-height: 1.5;
}
.note svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--green); }

.question {
    margin: 0 0 2rem;
    padding: 0;
    border: 0;
    min-width: 0;
}
.question[hidden] { display: none; }

.question__label {
    display: block;
    margin: 0 0 .35rem;
    padding: 0;
    font-size: 1.125rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--text);
}
.question__hint { margin: 0 0 1rem; font-size: .875rem; color: var(--subtle); }
.question__label + .options,
.question__label + .field { margin-top: 1rem; }

.options { display: grid; gap: .6rem; }
.options--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.option { position: relative; display: block; }
.option[hidden] { display: none; }

/* O input continua no fluxo de foco e do leitor de tela; só some visualmente. */
.option input {
    position: absolute;
    opacity: 0;
    width: 1px; height: 1px;
    margin: 0;
}

.option__box {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 56px;
    padding: .85rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .18s var(--ease), background-color .18s var(--ease), transform .12s var(--ease);
    -webkit-tap-highlight-color: transparent;
    line-height: 1.35;
    font-size: .9875rem;
    /* "Relacionamentos/namoro/casamento" não tem espaço para quebrar. */
    overflow-wrap: anywhere;
}
.option__box:hover { background: var(--card-hover); border-color: var(--line-strong); }
.option input:active + .option__box { transform: scale(.99); }

.option__mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.option--check .option__mark { border-radius: 7px; }
.option__mark svg {
    width: 14px; height: 14px;
    color: var(--green-ink);
    opacity: 0;
    transform: scale(.5);
    transition: opacity .15s var(--ease), transform .2s var(--ease);
}

.option input:checked + .option__box {
    border-color: var(--green);
    background: var(--green-soft);
}
.option input:checked + .option__box .option__mark {
    border-color: var(--green);
    background: var(--green);
}
.option input:checked + .option__box .option__mark svg { opacity: 1; transform: none; }
.option input:focus-visible + .option__box { outline: 2px solid var(--green); outline-offset: 3px; }

.options--grid .option__box { justify-content: center; text-align: center; font-weight: 600; }
.options--grid .option__mark { display: none; }

/* Campo que abre quando a pessoa escolhe algo (nome, "Outro"). */
.reveal-field { margin-top: .75rem; animation: reveal .3s var(--ease) both; }
.reveal-field[hidden] { display: none; }

.field { display: block; }
.field__label { display: block; margin: 0 0 .5rem; font-size: .9375rem; font-weight: 600; color: var(--muted); }

.input,
.textarea {
    width: 100%;
    padding: .9rem 1rem;
    background: var(--bg-raised);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font: inherit;
    font-size: 1rem; /* 16px: abaixo disso o iOS dá zoom no foco */
    line-height: 1.5;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--subtle); }
.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-soft);
}
.textarea { min-height: 128px; resize: vertical; }
.textarea--xl { min-height: 190px; }

/* Pertencimento: um card por frase, escala 1–5 em botões grandes. */
.likert { display: grid; gap: .75rem; margin: 0; }

.likert__item {
    margin: 0;
    padding: 1.1rem 1rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: border-color .2s var(--ease);
    min-width: 0;
}
.likert__item.is-answered { border-color: var(--line-strong); }

/* float + largura total: sem isso o navegador desenha o <legend> SOBRE a
   linha da borda do fieldset, e a frase aparece cortada pelo card. */
.likert__statement {
    float: left;
    width: 100%;
    display: block;
    margin: 0 0 .9rem;
    padding: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
}

.likert__scale {
    clear: both;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .45rem;
}

.likert__point { position: relative; display: block; }
.likert__point input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
/* `>` e não descendente: dentro do botão há o número e o texto de leitor de
   tela, e ambos herdavam a caixa — virava uma caixinha dentro da outra. */
.likert__point > span {
    display: grid;
    place-items: center;
    height: 50px;
    background: var(--bg-raised);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.0625rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: all .18s var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.likert__point > span:hover { border-color: var(--muted); }
.likert__point input:checked + span {
    background: var(--green);
    border-color: var(--green);
    color: var(--green-ink);
    transform: translateY(-1px);
}
.likert__point input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 3px; }

.likert__ends {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .5rem;
    font-size: .75rem;
    color: var(--subtle);
}
.likert__chosen {
    min-height: 1.35em;
    margin: .55rem 0 0;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--green);
}

/* Etapa final: sem cards, só o espaço para escrever. */
.step--open .question__label { font-size: 1.1875rem; }

/* Erros */
.error {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    margin: .75rem 0 0;
    padding: .7rem .9rem;
    background: var(--danger-soft);
    border: 1px solid rgba(255, 143, 133, .35);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.4;
}
.error[hidden] { display: none; }
.error svg { flex: none; margin-top: 1px; }
.has-error .option__box,
.has-error .likert__point > span,
.has-error .input,
.has-error .textarea { border-color: rgba(255, 143, 133, .55); }

/* Navegação fixa no rodapé do celular, ao alcance do polegar. */
.survey-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 10;
    padding: .9rem 0 calc(.9rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 62%, rgba(10, 12, 11, 0));
    /* O degradê é só visual: toque na parte transparente atinge o conteúdo
       por trás, não a barra. Só os botões capturam o toque. */
    pointer-events: none;
}
.survey-nav__inner { display: flex; gap: .75rem; pointer-events: auto; }
.survey-nav .btn { flex: 1; }
.survey-nav .btn--ghost { flex: 0 0 auto; min-width: 7.25rem; }
.survey-nav .btn--ghost[hidden] { display: none; }

/* Sem JS: botão de envio comum no fim do formulário. */
.no-js-submit { margin: 2rem 0 0; }

.honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------ obrigado -- */

.done {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 4rem;
}
.done__icon {
    display: grid;
    place-items: center;
    width: 76px; height: 76px;
    margin-bottom: 1.75rem;
    border-radius: 50%;
    background: var(--green-soft);
    border: 1px solid var(--green-line);
    color: var(--green);
    animation: pop .6s var(--ease) both;
}
.done__icon svg { width: 34px; height: 34px; }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.06); } 100% { opacity: 1; transform: none; } }

.done__title {
    margin: 0 0 1.25rem;
    font-size: clamp(1.9rem, 7.5vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -.03em;
    font-weight: 800;
}
.done p { margin: 0 0 1rem; color: var(--muted); font-size: 1.0625rem; max-width: 34rem; }
.done p.done__highlight { color: var(--text); font-weight: 600; }
.done .btn { margin-top: 1.25rem; align-self: flex-start; }

/* --------------------------------------------------------- telas maiores -- */

@media (min-width: 720px) {
    /* Só as laterais: a forma abreviada zerava o padding-top/bottom do
       cabeçalho, do hero e da tela final, e a logo encostava no topo. */
    .shell { padding-left: 2rem; padding-right: 2rem; }
    .brand__logo { height: 60px; }
    /* height: auto de novo: sem ele valeria o height da linha acima e a logo
       da landing esticava (480x60). */
    .brand__logo--lg { width: 30rem; height: auto; }
    .hero { padding-bottom: 5rem; }
    .btn--cta { width: auto; min-width: 22rem; }
    .hero__note { text-align: left; }
    .step__title, .survey-head__title { font-size: 1.875rem; }
    .options--grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .options--cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .likert__item { padding: 1.4rem 1.4rem 1.2rem; }
    .survey { padding-bottom: 3rem; }
    .survey-nav {
        position: static;
        padding: 1.5rem 0 0;
        background: none;
    }
    .survey-nav .btn--primary { flex: 0 0 auto; min-width: 12rem; margin-left: auto; }
    .survey-nav .shell { padding: 0; }
    html { scroll-padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
