/* ============================================================
   Fully Functional Autism Center - shared styles
   Brand: red (#d81f26) accents, clean clinical white, dark text.
   Mobile-first.
   ============================================================ */

:root {
    --red: #d81f26;
    --red-dark: #b3171d;
    --ink: #1a1f2b;
    --muted: #5a6473;
    --line: #e6e8ec;
    --bg: #ffffff;
    --soft: #fef5f5;
    --soft2: #f6f8fa;
    --green: #1f9d55;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(20, 30, 60, 0.08);
    --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; /* prevent any element from causing sideways scroll on mobile */
}

a { color: var(--red); text-decoration: none; }

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Top brand bar ---------- */
.brandbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    max-width: var(--maxw);
    margin: 0 auto;
}
.brandbar .logo-mark {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--red);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 800;
    font-size: 20px;
}
.brandbar .logo-img { height: 46px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.brandbar .brand-name { font-weight: 800; font-size: 20px; letter-spacing: .5px; }
.brandbar .brand-tag { color: var(--red); font-size: 13px; font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(160deg, #fff 0%, var(--soft) 100%);
    border-bottom: 1px solid var(--line);
    padding: 40px 0 56px;
}
.hero h1 {
    font-size: clamp(28px, 5vw, 46px);
    line-height: 1.15;
    margin: 10px 0 16px;
    letter-spacing: -0.5px;
}
.hero h1 .hl { color: var(--red); }
.hero p.sub {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--muted);
    max-width: 760px;
}
.pill {
    display: inline-block;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--red);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: var(--shadow);
}
.hero-cta { margin-top: 28px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    padding: 15px 26px;
    border-radius: 12px;
    transition: transform .08s ease, box-shadow .2s ease, background .2s;
    text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 10px 24px rgba(216,31,38,.3); }
.btn-primary:hover { background: var(--red-dark); }
.btn-whatsapp { background: #25d366; color: #fff; box-shadow: 0 10px 24px rgba(37,211,102,.3); }
.btn-whatsapp:hover { background: #1da851; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-lg { font-size: 18px; padding: 17px 32px; }
.btn-block { width: 100%; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--soft2); }
.section h2 {
    font-size: clamp(24px, 4vw, 34px);
    margin: 0 0 10px;
    letter-spacing: -0.3px;
}
.section .lead { color: var(--muted); max-width: 720px; margin-bottom: 32px; }
.section-eyebrow { color: var(--red); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}
.card .num {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--soft); color: var(--red);
    display: grid; place-items: center; font-weight: 800; font-size: 18px;
    margin-bottom: 14px;
}
.card h3 { margin: 0 0 8px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); }

/* pain point list */
.painlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.painlist li { display: flex; gap: 12px; align-items: flex-start; }
.painlist .x { color: var(--red); font-weight: 800; }
.painlist .ok { color: var(--green); font-weight: 800; }

/* testimonials */
.stars { color: #f5a623; letter-spacing: 2px; margin-bottom: 10px; }
.testi-name { font-weight: 800; margin-top: 14px; }
.testi-loc { color: var(--muted); font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--ink);
    color: #cfd4dd;
    padding: 44px 0 30px;
}
.site-footer h4 { color: #fff; margin: 0 0 14px; font-size: 16px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
.footer-contact div { margin-bottom: 10px; display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .lbl { color: #8b94a3; min-width: 72px; flex: 0 0 auto; }
/* let long emails / addresses wrap instead of overflowing the screen */
.footer-contact div > span:last-child {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.footer-bottom {
    border-top: 1px solid #2c3342;
    margin-top: 26px; padding-top: 18px;
    font-size: 13px; color: #8b94a3;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}

/* ---------- Sticky mobile CTA ---------- */
.sticky-cta {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--line);
    padding: 10px 16px;
    display: flex; gap: 10px;
    z-index: 50;
}
.sticky-cta .btn { flex: 1; padding: 13px; font-size: 15px; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,20,30,.6);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 14px 80px;
    overflow-y: auto;
    z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff;
    width: 100%;
    max-width: 760px;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0,0,0,.3);
    overflow: hidden;
    margin: auto 0;
}
.modal-head {
    background: var(--red);
    color: #fff;
    padding: 18px 24px;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-head .close { background: none; border: none; color: #fff; font-size: 26px; cursor: pointer; line-height: 1; }
.modal-body { padding: 24px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 14px; }
.field .req { color: var(--red); }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--red);
}
.field.invalid input, .field.invalid select { border-color: var(--red); background: #fff6f6; }
.field .err { color: var(--red); font-size: 13px; margin-top: 5px; display: none; }
.field.invalid .err { display: block; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* progress + steps */
.wizard-progress {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 24px; background: var(--soft2);
    border-bottom: 1px solid var(--line);
    font-size: 13px; color: var(--muted);
    flex-wrap: wrap;
}
.wizard-progress .bar {
    flex: 1; height: 8px; background: #e4e7ec; border-radius: 999px; overflow: hidden; min-width: 120px;
}
.wizard-progress .bar span { display: block; height: 100%; background: var(--red); width: 0; transition: width .3s; }

.step { display: none; }
.step.active { display: block; }
.step-title { font-size: 20px; margin: 0 0 4px; }
.step-title .code { color: var(--red); }
.step-desc { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

/* likert question */
.q {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
}
.q.unanswered-flag { border-color: var(--red); background: #fff8f8; }
.q .q-text { font-weight: 600; margin-bottom: 12px; }
.q .q-text .q-code { color: var(--red); font-weight: 800; margin-right: 6px; }
.likert { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.likert label {
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    transition: all .12s;
    background: #fff;
}
.likert label .n { display: block; font-weight: 800; font-size: 16px; }
.likert input { position: absolute; opacity: 0; pointer-events: none; }
.likert input:checked + label,
.likert label.sel { border-color: var(--red); background: var(--soft); color: var(--red); }

/* yes/no */
.yesno { display: flex; gap: 10px; }
.yesno label {
    flex: 1; border: 1.5px solid var(--line); border-radius: 10px;
    padding: 12px; text-align: center; cursor: pointer; font-weight: 700;
}
.yesno input { position: absolute; opacity: 0; }
.yesno input:checked + label, .yesno label.sel { border-color: var(--red); background: var(--soft); color: var(--red); }

.check-item { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.check-item input { width: 18px; height: 18px; margin-top: 3px; }

.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.form-alert {
    background: #fff6f6; border: 1px solid #f3c0c3; color: var(--red-dark);
    padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; display: none;
}
.form-alert.show { display: block; }

/* ---------- Thank you / result ---------- */
.result-wrap { max-width: 820px; margin: 40px auto; padding: 0 20px; }
.result-head {
    background: linear-gradient(160deg, var(--red), var(--red-dark));
    color: #fff; border-radius: 16px; padding: 30px; text-align: center;
}
.result-head .check { font-size: 48px; }

/* ---------- Admin ---------- */
.admin-top {
    background: var(--ink); color: #fff; padding: 14px 0;
}
.admin-top .container { display: flex; justify-content: space-between; align-items: center; }
.admin-top a { color: #cfd4dd; margin-left: 18px; }
.admin-top a.active { color: #fff; font-weight: 700; }
.table {
    width: 100%; border-collapse: collapse; background: #fff;
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { background: var(--soft2); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.table tr:hover td { background: #fafbfc; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.yes { background: #e7f6ee; color: var(--green); }
.badge.no { background: #f1f3f6; color: var(--muted); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.detail-grid .k { color: var(--muted); font-size: 13px; }
.detail-grid .v { font-weight: 600; margin-bottom: 8px; }

.score-table { width: 100%; border-collapse: collapse; margin: 10px 0 24px; }
.score-table th, .score-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.score-table th { background: var(--soft2); }
.score-table .total-row td { font-weight: 800; background: var(--soft); }

.login-box {
    max-width: 380px; margin: 80px auto; background: #fff;
    border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
    .row2 { grid-template-columns: 1fr; }
    .likert { grid-template-columns: repeat(2, 1fr); }
    body { padding-bottom: 70px; } /* room for sticky cta */
}
@media (min-width: 541px) {
    .sticky-cta { display: none; }
}
