/* =====================================================================
   Autismo Online — Stylesheet
   Paleta inspirada no símbolo do infinito arco-íris da comunidade autista
   + azul oficial do Dia Mundial de Conscientização do Autismo (2 de abril)
===================================================================== */

:root {
    /* Azul oficial */
    --blue-50:  #E3F2FD;
    --blue-100: #BBDEFB;
    --blue-300: #64B5F6;
    --blue-500: #1E88E5;
    --blue-600: #1976D2;
    --blue-700: #1565C0;

    /* Arco-íris (espectro) */
    --red:    #E53935;
    --orange: #FB8C00;
    --yellow: #FDD835;
    --green:  #43A047;
    --indigo: #3949AB;
    --violet: #8E24AA;

    /* Neutros */
    --gray-50:  #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    --bg:      #F6F9FC;
    --surface: #FFFFFF;
    --text:    var(--gray-900);
    --muted:   var(--gray-500);
    --border:  var(--gray-200);

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow:    0 6px 18px -8px rgba(15, 23, 42, .15);
    --shadow-lg: 0 18px 48px -16px rgba(15, 23, 42, .25);

    --grad-rainbow: linear-gradient(90deg, var(--red) 0%, var(--orange) 20%, var(--yellow) 40%, var(--green) 60%, var(--blue-500) 80%, var(--violet) 100%);
    --grad-hero:    linear-gradient(135deg, #E3F2FD 0%, #FFF8E1 50%, #E8F5E9 100%);

    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ==== Reset / base ==== */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--gray-900); }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.75rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { margin: 0 0 1rem; }

button { font-family: inherit; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

/* ==== Topbar ==== */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow-sm);
}
.topbar::before {
    content: ""; display: block; height: 4px; background: var(--grad-rainbow);
}
.topbar__inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: .9rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__icon { display: inline-flex; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__text strong { font-size: 1.05rem; color: var(--gray-900); letter-spacing: -.01em; }
.brand__text small  { font-size: .8rem; color: var(--muted); margin-top: 2px; }

.topbar__nav { display: flex; gap: 1rem; }
.topbar__link {
    color: var(--gray-700); font-weight: 500; padding: .35rem .75rem;
    border-radius: var(--radius-sm); transition: background .15s;
}
.topbar__link:hover { background: var(--gray-100); text-decoration: none; }

.main { min-height: calc(100vh - 200px); }

/* ==== Footer ==== */
.footer {
    margin-top: 4rem;
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 2.5rem 0;
    border-top: 4px solid transparent;
    background-image: linear-gradient(var(--gray-900), var(--gray-900)), var(--grad-rainbow);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}
.footer__inner p { margin: 0 0 .6rem; font-size: .9rem; }
.footer a { color: var(--blue-300); }
.footer__credits { color: var(--gray-400); font-size: .82rem; }

/* ==== Hero ==== */
.hero { background: var(--grad-hero); padding: 3.5rem 0 4rem; }
.hero__grid {
    display: grid; gap: 2.5rem;
    grid-template-columns: 1fr;
    align-items: center;
}
@media (min-width: 900px) {
    .hero__grid { grid-template-columns: 1.1fr 1fr; gap: 3rem; }
}

.hero__badge {
    display: inline-block;
    background: rgba(30, 136, 229, .12);
    color: var(--blue-700);
    font-weight: 600; font-size: .8rem;
    padding: .35rem .85rem; border-radius: 999px;
    margin-bottom: 1rem;
    letter-spacing: .03em; text-transform: uppercase;
}
.hero__title { margin-bottom: 1rem; }
.hero__lead { font-size: 1.1rem; color: var(--gray-700); max-width: 32em; }

.rainbow-text {
    background: var(--grad-rainbow);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.hero__bullets { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .6rem; }
.hero__bullets li { display: flex; align-items: center; gap: .65rem; color: var(--gray-700); }
.dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.dot--blue   { background: var(--blue-500); }
.dot--green  { background: var(--green); }
.dot--yellow { background: var(--yellow); }
.dot--red    { background: var(--red); }

/* ==== Card / Form ==== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.card__title { margin-bottom: .25rem; }
.card__subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: .95rem; }

.form { position: relative; overflow: hidden; }
.form::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: var(--grad-rainbow);
}
.form__field { display: flex; flex-direction: column; margin-bottom: 1rem; }
.form__row {
    display: grid; gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 540px) {
    .form__row { grid-template-columns: 1fr 1fr; }
}

.form__field label {
    font-size: .9rem; font-weight: 600; color: var(--gray-700); margin-bottom: .35rem;
}
.form__field input {
    width: 100%;
    padding: .8rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form__field input:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(30, 136, 229, .15);
}
.form__hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.form__error { font-size: .82rem; color: var(--red); margin-top: .35rem; font-weight: 500; }

.form__check {
    display: flex; gap: .65rem; align-items: flex-start;
    font-size: .88rem; color: var(--gray-700); margin: 1rem 0 1.25rem;
    cursor: pointer;
}
.form__check input { margin-top: .25rem; flex-shrink: 0; accent-color: var(--blue-500); }

/* ==== Buttons ==== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .85rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    font-weight: 600; font-size: 1rem;
    cursor: pointer;
    transition: transform .12s, background .15s, color .15s, box-shadow .15s, opacity .15s;
    text-decoration: none;
}
.btn--primary {
    background: var(--blue-500);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(30, 136, 229, .55);
}
.btn--primary:hover { background: var(--blue-600); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn--primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn--ghost {
    background: transparent;
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.btn--ghost:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.btn--block { width: 100%; }

/* ==== Alerts ==== */
.alert {
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .92rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}
.alert--error { background: #FEF2F2; color: #991B1B; border-color: var(--red); }

/* ==== Info section ==== */
.info { padding: 4rem 0; }
.info__grid {
    display: grid; gap: 1.25rem;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) {
    .info__grid { grid-template-columns: repeat(3, 1fr); }
}
.info-card {
    background: var(--surface);
    padding: 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.info-card__icon {
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    font-size: 1.4rem; font-weight: 700;
    margin-bottom: .9rem;
}
.info-card h3 { margin-bottom: .35rem; }
.info-card p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ==== Quiz ==== */
.quiz { padding: 2.5rem 0 3.5rem; }
.quiz__header { margin-bottom: 2rem; }
.quiz__eyebrow {
    font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
    font-weight: 600; color: var(--blue-600);
}
.quiz__title { margin: .35rem 0 .25rem; }
.quiz__subtitle { color: var(--muted); margin-bottom: 1.25rem; }
.quiz__alert {
    background: #FFFBEB;
    border-left: 4px solid var(--yellow);
    padding: 1rem 1.1rem;
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    font-size: .92rem;
    margin-bottom: 1.5rem;
}

.progress {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .35rem .35rem .35rem 1rem;
    display: flex; align-items: center; gap: .75rem;
    box-shadow: var(--shadow-sm);
    position: sticky; top: 70px; z-index: 5;
}
.progress__bar {
    flex: 1;
    height: 8px;
    background: var(--gray-100);
    border-radius: 999px; overflow: hidden;
}
.progress__fill {
    display: block; height: 100%;
    background: var(--grad-rainbow);
    width: 0%;
    transition: width .3s ease;
}
.progress__text {
    font-size: .82rem; color: var(--muted); padding-right: .75rem; flex-shrink: 0;
    font-weight: 600;
}

.quiz__list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; }

.qcard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.qcard.is-answered {
    border-color: var(--blue-300);
    box-shadow: 0 6px 16px -10px rgba(30, 136, 229, .35);
}
.qcard__head {
    display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem;
    font-size: .82rem;
}
.qcard__num {
    width: 30px; height: 30px;
    background: var(--blue-50); color: var(--blue-700);
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; font-weight: 700;
    flex-shrink: 0;
}
.qcard__domain {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}
.qcard__text {
    font-size: 1.05rem;
    color: var(--gray-800);
    margin: 0 0 1.1rem;
    line-height: 1.55;
}

.qcard__options {
    display: grid; gap: .65rem;
    grid-template-columns: 1fr 1fr;
}
.qopt {
    display: flex; align-items: center; gap: .65rem;
    padding: .85rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s;
    background: var(--surface);
    user-select: none;
}
.qopt:hover { border-color: var(--gray-300); background: var(--gray-50); }
.qopt input { position: absolute; opacity: 0; pointer-events: none; }
.qopt__check {
    width: 24px; height: 24px;
    border-radius: 999px;
    border: 1.5px solid var(--gray-300);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
    color: transparent;
    transition: all .15s;
    flex-shrink: 0;
}
.qopt__label { font-weight: 600; color: var(--gray-700); }

.qopt--yes.is-selected {
    border-color: var(--green); background: #E8F5E9;
}
.qopt--yes.is-selected .qopt__check { background: var(--green); border-color: var(--green); color: #fff; }
.qopt--yes.is-selected .qopt__label { color: #1B5E20; }

.qopt--no.is-selected {
    border-color: var(--blue-500); background: var(--blue-50);
}
.qopt--no.is-selected .qopt__check { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }
.qopt--no.is-selected .qopt__label { color: var(--blue-700); }

.quiz__actions {
    margin-top: 2rem;
    display: flex; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap;
}

/* ==== Result ==== */
.result { padding: 3rem 0 4rem; }
.result__header {
    text-align: center; max-width: 720px; margin: 0 auto 2rem;
}
.result__eyebrow {
    text-transform: uppercase; font-size: .82rem; letter-spacing: .08em;
    font-weight: 600; color: var(--blue-600);
}
.result__title {
    margin: .5rem 0 1rem;
    font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
}
.result__lead { color: var(--gray-700); font-size: 1.05rem; }

/* Cores por nível */
.result--verde   .result__title { color: var(--green); }
.result--amarelo .result__title { color: #B25600; }
.result--vermelho .result__title { color: var(--red); }

.result--verde   .result-card__value--badge { background: #E8F5E9; color: #1B5E20; }
.result--amarelo .result-card__value--badge { background: #FFF8E1; color: #8D5300; }
.result--vermelho .result-card__value--badge { background: #FFEBEE; color: #B71C1C; }

.result__cards {
    display: grid; gap: 1rem;
    grid-template-columns: 1fr;
    margin-bottom: 2rem;
}
@media (min-width: 720px) {
    .result__cards { grid-template-columns: repeat(3, 1fr); }
}
.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.result-card__label { color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.result-card__value {
    display: block; font-size: 2.4rem; font-weight: 800; margin: .5rem 0; line-height: 1;
    color: var(--gray-900);
}
.result-card__value small { font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.result-card__value--badge {
    display: inline-block; font-size: 1rem; padding: .4rem 1rem;
    border-radius: 999px; letter-spacing: .05em;
}
.result-card__hint { color: var(--muted); font-size: .82rem; margin: .25rem 0 0; }
.result-card__bar {
    height: 8px; background: var(--gray-100);
    border-radius: 999px; overflow: hidden; margin-top: .5rem;
}
.result-card__bar span {
    display: block; height: 100%;
    background: var(--grad-rainbow);
}

.result__guide {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}
.result__guide h2 { margin-bottom: .75rem; }
.result__guide p { color: var(--gray-700); }

.result__steps {
    display: grid; gap: 1rem;
    grid-template-columns: 1fr;
    margin-top: 1.5rem;
}
@media (min-width: 720px) {
    .result__steps { grid-template-columns: repeat(3, 1fr); }
}
.step-card {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 1.1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.step-card__num {
    width: 36px; height: 36px;
    background: var(--blue-500); color: #fff;
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; flex-shrink: 0;
}
.step-card h3 { margin: 0 0 .25rem; font-size: 1rem; }
.step-card p  { margin: 0; font-size: .9rem; color: var(--muted); }

.result__details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}
.result__details summary {
    cursor: pointer; font-weight: 600; padding: .5rem 0;
    color: var(--blue-600);
    list-style: none;
}
.result__details summary::-webkit-details-marker { display: none; }
.result__details summary::before {
    content: "▸ "; transition: transform .2s; display: inline-block; margin-right: .25rem;
}
.result__details[open] summary::before { transform: rotate(90deg); }

.result__list { list-style: none; padding: 0; margin: 1rem 0 0; }
.rline {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: .75rem;
    padding: .85rem 0;
    border-top: 1px solid var(--border);
    align-items: start;
}
.rline:first-child { border-top: none; }
.rline__num {
    width: 28px; height: 28px;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .82rem; font-weight: 700;
    flex-shrink: 0;
}
.rline__domain { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.rline__text   { margin: .15rem 0 0; font-size: .92rem; color: var(--gray-700); line-height: 1.45; }
.rline__resp {
    font-size: .82rem; font-weight: 700; padding: .3rem .7rem;
    border-radius: 999px; white-space: nowrap;
    align-self: center;
}
.rline__resp small { display: block; font-weight: 500; font-size: .7rem; }
.rline--ok    .rline__resp { background: #E8F5E9; color: #1B5E20; }
.rline--alert .rline__resp { background: #FFEBEE; color: #B71C1C; }
.rline--alert .rline__num  { background: #FFEBEE; color: #B71C1C; }

.result__actions {
    display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
    margin-bottom: 2rem;
}

.result__disclaimer {
    background: #FFFBEB;
    border-left: 4px solid var(--yellow);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    color: var(--gray-700); font-size: .9rem;
}

/* ==== Error pages ==== */
.error-page { padding: 5rem 0; }
.error-card {
    text-align: center;
    background: var(--surface);
    padding: 3rem 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-width: 480px; margin: 0 auto;
    box-shadow: var(--shadow-sm);
}
.error-card h1 {
    font-size: 4rem;
    background: var(--grad-rainbow);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: .5rem;
}
.error-card p { color: var(--muted); margin-bottom: 1.5rem; }

/* ==== Print ==== */
@media print {
    .topbar, .footer, .result__actions, .quiz__actions { display: none; }
    body { background: #fff; }
    .result__details[open] summary { display: none; }
    .card, .qcard, .info-card, .result-card, .result__guide, .result__details {
        box-shadow: none; border: 1px solid #ccc;
    }
}
