:root {
    --navy: #163A70;
    --blue: #1E5EFF;
    --green: #20C997;
    --bg: #F4F7FB;
    --white: #FFFFFF;
    --text: #152942;
    --muted: #64748B;
    --border: #E7EDF5;
    --soft-blue: #EDF3FF;
    --soft-green: #E7FBF4;
    --danger: #CF3C52;
    --shadow: 0 12px 35px rgba(22, 58, 112, .08);
    --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--navy); line-height: 1.14; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 8vw, 3.3rem); margin-bottom: 16px; }
h2 { font-size: clamp(1.45rem, 5vw, 2.2rem); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; }
button[hidden], .button[hidden] { display: none; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.narrow { max-width: 540px; }
.site-header {
    position: sticky; top: 0; z-index: 20; height: 70px;
    background: rgba(244, 247, 251, .92); backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(231, 237, 245, .8);
}
.header-row { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--navy); }
.brand-mark { width: 37px; height: 37px; flex-shrink: 0; }
.brand-name { font-size: 1.18rem; font-weight: 750; letter-spacing: -.03em; white-space: nowrap; }
.brand-name strong { color: var(--green); }
.top-nav { display: flex; gap: 14px; align-items: center; font-weight: 600; font-size: .94rem; }
.top-nav form { margin: 0; }
.link-button { color: var(--blue); background: transparent; padding: 0; font-weight: inherit; }
.button {
    min-height: 52px; padding: 14px 22px; border-radius: 13px; display: inline-flex;
    justify-content: center; align-items: center; gap: 8px; font-weight: 700; transition: .2s ease;
}
.button.primary { background: var(--blue); color: white; }
.button.primary:hover { background: var(--navy); }
.button.cta { color: white; background: var(--green); }
.button.cta:hover { background: #16ab80; }
.button.secondary { color: var(--navy); background: var(--soft-blue); }
.button.secondary:hover { background: #dce8ff; }
.button.ghost { color: var(--navy); border: 1px solid var(--border); background: var(--white); }
.button.small { min-height: 42px; padding: 9px 15px; border-radius: 11px; }
.button.block { display: flex; width: 100%; }
.hero { padding: 42px 0 52px; }
.hero-grid { display: grid; gap: 30px; }
.trust-label, .eyebrow {
    font-size: .78rem; font-weight: 750; color: var(--blue); text-transform: uppercase;
    letter-spacing: .11em; margin-bottom: 14px;
}
.hero-copy .lead { font-size: 1.04rem; color: var(--muted); margin-bottom: 27px; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 16px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.hero-trust span::before { content: "✓"; color: var(--green); margin-right: 6px; font-weight: 800; }
.hero-card, .feature-card, .assurance-card, .form-card, .checkout-card, .panel, .status-card, .empty-card, .admin-panel {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
}
.hero-card { padding: 20px; box-shadow: var(--shadow); }
.doctor-badge {
    display: flex; align-items: center; gap: 13px; padding: 14px; border-radius: 15px;
    background: var(--soft-blue); margin-bottom: 22px;
}
.avatar {
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
    color: white; background: var(--blue); font-size: 30px; font-weight: 400;
}
.doctor-badge strong { display: block; color: var(--navy); }
.doctor-badge small { display: block; color: var(--muted); font-size: .79rem; }
.journey { margin: 0 4px 25px 20px; border-left: 2px solid var(--border); }
.journey-item { display: flex; gap: 16px; align-items: center; padding: 0 0 21px 17px; color: var(--muted); }
.journey-item:last-child { padding-bottom: 0; }
.journey-item b {
    margin-left: -32px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: var(--white); border: 2px solid var(--border); color: var(--muted); font-size: .82rem;
}
.journey-item.active b { color: white; border-color: var(--green); background: var(--green); }
.section { padding: 52px 0; }
.section.soft { background: #eef4fc; }
.section-heading { text-align: center; max-width: 580px; margin: 0 auto 28px; }
.feature-grid { display: grid; gap: 14px; }
.feature-card { padding: 24px 21px; }
.feature-card .icon {
    width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px;
    background: var(--soft-blue); color: var(--blue); font-weight: 750; margin-bottom: 18px;
}
.feature-card h3 { margin-bottom: 9px; }
.feature-card p, .assurance-card p { color: var(--muted); margin-bottom: 0; }
.info-grid { display: grid; gap: 25px; }
.lead.small { color: var(--muted); }
.assurance-card { padding: 23px; }
.assurance-card p { margin-bottom: 23px; }
.site-footer { padding: 25px 0; color: var(--muted); font-size: .88rem; }
.footer-row { display: flex; flex-direction: column; gap: 5px; }

.auth-section, .registration-section, .flow-section { min-height: calc(100vh - 150px); padding: 28px 0 48px; }
.form-card { width: min(100% - 32px, 540px); margin: 0 auto; padding: 25px 20px; }
.form-card.compact { max-width: 430px; }
.form-card h1, .flow-heading h1 { font-size: clamp(1.7rem, 7vw, 2.25rem); }
.muted { color: var(--muted); }
.center { text-align: center; margin-top: 25px; margin-bottom: 0; }
.stack-form { display: grid; gap: 17px; margin-top: 26px; }
.stack-form label, .coupon-form label {
    display: grid; gap: 7px; color: var(--navy); font-size: .92rem; font-weight: 650;
}
input, textarea, select {
    width: 100%; border: 1px solid #D6E0EE; border-radius: 12px; padding: 14px;
    min-height: 52px; background: white; color: var(--text); outline: none; transition: border .18s, box-shadow .18s;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 94, 255, .13); }
.form-head { margin-bottom: 25px; }
.form-head h1 { margin-bottom: 22px; }
.step-progress { display: flex; align-items: center; }
.step-progress span {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    border: 2px solid var(--border); color: var(--muted); font-weight: 700;
}
.step-progress span.active, .step-progress span.done { border-color: var(--blue); background: var(--blue); color: white; }
.step-progress i { height: 2px; width: 45px; background: var(--border); }
.step-progress i.done { background: var(--blue); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-step { display: grid; gap: 16px; }
.form-step[hidden] { display: none; }
.form-step legend { display: block; font-size: 1.25rem; font-weight: 700; color: var(--navy); margin-bottom: 19px; }
.helper { color: var(--muted); font-size: .78rem; font-weight: 400; }
.helper.success { color: #158361; }
.field-error { color: var(--danger); font-size: .8rem; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-fields.city { grid-template-columns: 1fr 82px; }
.actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 6px; }

.flow-heading { text-align: center; margin-bottom: 24px; }
.flow-heading p:not(.eyebrow) { color: var(--muted); }
.checkout-card { padding: 23px 20px; }
.checkout-card h2 { font-size: 1.25rem; margin-bottom: 21px; }
.membership-active { text-align: center; }
.membership-active h2 { margin-bottom: 8px; }
.membership-active p { margin-bottom: 23px; }
.simple-link { display: inline-block; font-weight: 650; margin-top: 19px; }
.block-link { display: block; text-align: center; }
.small-check { width: 55px; height: 55px; font-size: 27px; margin-bottom: 18px; }
.price-row { display: flex; justify-content: space-between; padding-bottom: 15px; color: var(--muted); }
.price-row strong { color: var(--text); }
.price-row.discount strong { color: var(--green); }
.price-total {
    display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--border);
    padding: 16px 0; font-weight: 650;
}
.price-total strong { color: var(--navy); font-size: 1.65rem; }
.clean-checks { list-style: none; padding: 2px 0 20px; margin: 0; color: var(--muted); font-size: .9rem; }
.clean-checks li { padding: 6px 0; }
.clean-checks li::before { content: "✓"; color: var(--green); font-weight: 800; margin-right: 9px; }
.coupon-form { border-top: 1px solid var(--border); padding: 19px 0 22px; }
.input-button { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 7px; }
.coupon-feedback { min-height: 20px; font-size: .86rem; margin: 9px 0 0; color: var(--green); }
.coupon-feedback.error { color: var(--danger); }
.secure-note { color: var(--muted); font-size: .78rem; text-align: center; margin: 16px 0 0; }
.pix-card { text-align: center; }
.client-toast {
    position: fixed; top: 82px; right: 16px; z-index: 45; width: min(330px, calc(100% - 32px));
    opacity: 0; transform: translateY(-8px); transition: opacity .22s, transform .22s;
    background: var(--white); color: var(--text); border-radius: 13px; border: 1px solid var(--border);
    border-left: 4px solid var(--green); box-shadow: var(--shadow); padding: 14px 15px; text-align: left;
}
.client-toast.visible { opacity: 1; transform: translateY(0); }
.pix-countdown {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px;
    border-radius: 12px; padding: 11px 14px; color: var(--navy); background: var(--soft-green);
}
.pix-countdown span { font-size: .84rem; font-weight: 650; }
.pix-countdown strong { font-size: 1.18rem; color: #11825e; letter-spacing: .03em; }
.pix-qr { display: block; width: min(252px, 100%); margin: 0 auto 19px; border-radius: 12px; }
.pix-copy-label { display: grid; text-align: left; gap: 7px; color: var(--navy); font-size: .92rem; font-weight: 650; margin: 8px 0 13px; }
.pix-copy-label textarea { font-size: .82rem; color: var(--muted); word-break: break-all; }
.pix-waiting {
    display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 21px;
    padding: 14px; border-radius: 12px; background: var(--soft-blue); color: var(--navy);
}
.pix-waiting p { margin: 0; font-size: .9rem; }
.waiting-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: dotPulse 1.3s infinite; }
@keyframes dotPulse { 50% { opacity: .28; transform: scale(.8); } }
.toast-stack { position: fixed; z-index: 40; right: 16px; top: 82px; width: min(360px, calc(100% - 32px)); }
.toast {
    background: white; color: var(--text); border-radius: 13px; border: 1px solid var(--border);
    border-left: 4px solid var(--blue); box-shadow: var(--shadow); padding: 14px 15px; margin-bottom: 8px;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--danger); }

.quiz-page { min-height: calc(100vh - 70px); display: flex; align-items: stretch; padding: 28px 16px 42px; }
.quiz-shell {
    margin: 0 auto; width: min(560px, 100%); background: white; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 25px 20px; min-height: 540px;
}
.quiz-meter { height: 5px; background: var(--border); border-radius: 4px; margin-bottom: 42px; overflow: hidden; }
.quiz-meter span { display: block; height: 100%; width: 7%; background: var(--green); transition: width .25s; }
.quiz-step { display: none; }
.quiz-step.active { display: block; animation: fadeUp .24s ease; }
.quiz-step h1, .quiz-step h2 { font-size: clamp(1.5rem, 6vw, 2rem); margin-bottom: 28px; }
.choice-grid { display: grid; gap: 11px; margin-bottom: 27px; }
.choice input, .pill input { position: absolute; opacity: 0; }
.choice span {
    display: block; border: 1px solid var(--border); border-radius: 14px; padding: 17px 16px; font-weight: 650;
    color: var(--navy); transition: .18s;
}
.choice input:checked + span { background: var(--soft-blue); border-color: var(--blue); color: var(--blue); }
.choice-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.choice-row.triple { grid-template-columns: repeat(3, 1fr); }
.pill span {
    display: grid; place-items: center; min-height: 58px; border: 1px solid var(--border);
    border-radius: 14px; color: var(--navy); font-weight: 650;
}
.pill input:checked + span { background: var(--soft-blue); color: var(--blue); border-color: var(--blue); }
.quiz-navigation { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin-top: 37px; }
.quiz-navigation[hidden] { display: none; }
.search-doctor {
    min-height: calc(100vh - 136px); padding: 34px 20px; display: grid; place-items: center; text-align: center;
}
.search-state, .found-state { max-width: 470px; }
.pulse-orbit {
    position: relative; display: grid; place-items: center; width: 118px; height: 118px; margin: 0 auto 42px;
    border-radius: 50%; background: var(--soft-blue);
}
.pulse-orbit::before, .pulse-orbit::after {
    content: ""; position: absolute; inset: 0; border: 1px solid rgba(30,94,255,.28);
    border-radius: 50%; animation: ripple 2s infinite;
}
.pulse-orbit::after { animation-delay: 1s; }
.medical-plus, .success-check {
    width: 72px; height: 72px; border-radius: 50%; background: var(--blue); color: white;
    display: grid; place-items: center; font-size: 46px; font-weight: 350;
}
.found-state h1 { font-size: clamp(1.65rem, 7vw, 2.35rem); }
.found-state p:not(.eyebrow) { color: var(--muted); margin-bottom: 29px; }
.success-check { margin: 0 auto 24px; font-size: 33px; background: var(--green); }
@keyframes ripple { from { transform: scale(1); opacity: 1; } to { transform: scale(1.75); opacity: 0; } }
@keyframes fadeUp { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.dashboard-page { padding: 30px 0 50px; }
.welcome h1 { font-size: 2rem; margin-bottom: 9px; }
.welcome > p:last-child { color: var(--muted); margin-bottom: 25px; }
.status-card { padding: 21px; background: var(--navy); color: white; margin-bottom: 16px; }
.status-card p, .status-card h2 { color: white; margin-bottom: 7px; }
.status-card h2 { font-size: 1.4rem; }
.appointment { border-top: 1px solid rgba(255,255,255,.2); padding-top: 17px; margin-top: 16px; display: grid; }
.appointment small, .appointment span { opacity: .75; }
.appointment strong { font-size: 1.32rem; margin: 3px 0; }
.empty-card { padding: 23px; margin-bottom: 16px; }
.empty-card h2 { font-size: 1.3rem; }
.dashboard-grid { display: grid; gap: 13px; }
.panel { padding: 19px 17px; }
.panel-title h2 { font-size: 1.15rem; margin-bottom: 17px; }
.list-item {
    display: flex; justify-content: space-between; gap: 10px; align-items: center;
    padding: 13px 0; border-top: 1px solid var(--border);
}
.list-item strong { display: block; color: var(--navy); font-size: .93rem; }
.list-item small { display: block; color: var(--muted); }
.badge {
    display: inline-flex; border-radius: 99px; padding: 5px 9px; color: var(--blue);
    background: var(--soft-blue); font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.badge.success { color: #11825e; background: var(--soft-green); }
.notice { border-top: 1px solid var(--border); padding: 12px 0; }
.notice strong { color: var(--navy); font-size: .9rem; }
.notice p { color: var(--muted); margin: 4px 0; font-size: .88rem; }
.notice small { color: var(--muted); font-size: .74rem; }
.next-billing { border-top: 1px solid var(--border); display: grid; padding-top: 14px; margin-top: 5px; }
.next-billing small { color: var(--muted); }
.next-billing strong { color: var(--navy); font-size: 1.15rem; }
.personal-data p { margin: 5px 0; color: var(--muted); }
.personal-data strong { color: var(--navy); }
.mobile-action { margin-top: 18px; }
.billing-summary {
    display: grid; gap: 18px; padding: 22px 20px; border-radius: var(--radius);
    margin-bottom: 16px; color: white; background: var(--navy);
}
.billing-summary p, .billing-summary h2 { color: white; margin-bottom: 7px; }
.billing-summary p { font-size: .86rem; opacity: .8; }
.billing-summary h2 { font-size: 1.3rem; }
.billing-summary small { opacity: .78; }
.billing-summary.overdue { background: white; border: 1px solid var(--border); color: var(--text); }
.billing-summary.overdue p { color: var(--danger); opacity: 1; }
.billing-summary.overdue h2 { color: var(--navy); }
.billing-summary.overdue small { color: var(--muted); }
.payment-row {
    border-top: 1px solid var(--border); display: flex; justify-content: space-between;
    align-items: center; gap: 14px; padding: 15px 0;
}
.payment-row strong { display: block; color: var(--navy); font-size: 1.05rem; }
.payment-row small { color: var(--muted); display: block; }
.payment-details { text-align: right; display: grid; justify-items: end; gap: 5px; }
.pagination { display: flex; justify-content: space-between; margin-top: 16px; gap: 8px; }
.error-page { min-height: calc(100vh - 150px); display: grid; place-content: center; text-align: center; padding: 20px; }
.error-page p { color: var(--muted); }
.dev-message { background: #fff; border: 1px solid var(--border); padding: 13px; margin: 10px 0 21px; border-radius: 10px; font-size: .85rem; }

.admin-auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.admin-login-card { width: min(420px, 100%); background: white; border-radius: var(--radius); padding: 27px 23px; border: 1px solid var(--border); }
.admin-login-card .brand { margin-bottom: 37px; }
.admin-login-card h1 { font-size: 1.85rem; }
.admin-sidebar { display: none; }
.admin-main { padding: 16px; }
.admin-mobile-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }
.admin-heading h1 { font-size: 1.85rem; margin: 0; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.stats-grid article { background: white; padding: 17px 14px; border-radius: 14px; border: 1px solid var(--border); }
.stats-grid strong { display: block; color: var(--navy); font-size: 1.55rem; }
.stats-grid span { color: var(--muted); font-size: .8rem; }
.admin-panel { padding: 17px; margin-bottom: 16px; }
.admin-panel .panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.admin-panel .panel-title h2 { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; padding: 10px; color: var(--muted); font-weight: 650; white-space: nowrap; }
td { border-top: 1px solid var(--border); padding: 12px 10px; white-space: nowrap; }
.table-sub { display: block; color: var(--muted); }
.inline-status { display: flex; align-items: center; gap: 7px; }
.inline-status select { min-height: 41px; padding: 7px; min-width: 180px; }
.admin-columns { display: grid; gap: 14px; }
.form-panel { max-width: 480px; }
.form-panel h2 { font-size: 1.3rem; }
.settings-form { max-width: 460px; }
.integration-form { margin-top: 18px; }
.integration-state {
    padding: 10px 12px; border-radius: 10px; font-size: .86rem; font-weight: 700; margin: 14px 0;
}
.integration-state.ready { color: #11825e; background: var(--soft-green); }
.integration-state.waiting { color: var(--muted); background: var(--bg); }
.settings-feedback {
    border-radius: 11px; padding: 12px; font-size: .9rem; margin: 14px 0;
    border: 1px solid var(--border);
}
.settings-feedback.success { color: #11825e; background: var(--soft-green); border-color: #b4ead8; }
.settings-feedback.error { color: var(--danger); background: #fff0f3; border-color: #f3c4cb; }
.settings-alert {
    background: #fff5e8; border: 1px solid #ffd9a5; color: #8b570c; border-radius: 11px;
    padding: 12px; font-size: .88rem; margin: 14px 0;
}
.check-field { grid-template-columns: auto 1fr; align-items: center; gap: 9px !important; }
.check-field input { width: 19px; height: 19px; min-height: auto; }
.webhook-box { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 18px; }
.webhook-box strong { color: var(--navy); }
.webhook-box p { color: var(--muted); font-size: .86rem; margin: 6px 0 10px; }
.webhook-box input { font-size: .8rem; color: var(--muted); }
.admin-switch { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-caption { margin-bottom: 17px; }
.admin-pagination { justify-content: flex-start; align-items: center; margin-bottom: 22px; }
.page-current { color: var(--muted); font-size: .85rem; }
.answer-list { max-width: 720px; }
.answer-list h2 { font-size: 1.3rem; }
.answer-list article { padding: 15px 0; border-top: 1px solid var(--border); }
.answer-list article p { color: var(--muted); font-size: .9rem; margin-bottom: 5px; }
.answer-list article strong { color: var(--navy); }

@media (min-width: 700px) {
    .hero { padding: 72px 0; }
    .hero-grid { grid-template-columns: 1.02fr .84fr; gap: 55px; align-items: center; }
    .hero-actions { flex-direction: row; }
    .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .info-grid { grid-template-columns: 1fr 370px; align-items: center; }
    .footer-row { flex-direction: row; justify-content: space-between; }
    .form-card { padding: 32px 34px; }
    .quiz-shell { padding: 32px 39px; }
    .status-card { display: flex; justify-content: space-between; align-items: center; padding: 25px; }
    .appointment { border-top: 0; border-left: 1px solid rgba(255,255,255,.2); margin-top: 0; padding: 0 0 0 26px; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .billing-summary { grid-template-columns: 1fr auto; align-items: center; padding: 25px; }
}
@media (min-width: 960px) {
    .admin-page { display: grid; grid-template-columns: 255px 1fr; }
    .admin-sidebar {
        min-height: 100vh; display: flex; position: sticky; top: 0; flex-direction: column; padding: 27px 22px;
        background: white; border-right: 1px solid var(--border);
    }
    .admin-sidebar nav { display: grid; gap: 5px; margin: 46px 0 auto; }
    .admin-sidebar nav a { padding: 11px 12px; border-radius: 10px; color: var(--navy); }
    .admin-sidebar nav a:hover { background: var(--soft-blue); color: var(--blue); }
    .admin-main { padding: 33px 38px; max-width: 1200px; width: 100%; }
    .admin-mobile-top { display: none; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
    .admin-columns { grid-template-columns: 360px 1fr; }
}
