:root {
    color-scheme: light;
    --tc-primary: #2563eb;
    --tc-primary-dark: #1d4ed8;
    --tc-primary-soft: #eff6ff;
    --tc-accent: #0f766e;
    --tc-text: #0f172a;
    --tc-muted: #526177;
    --tc-surface: #fff;
    --tc-background: #f8fafc;
    --tc-border: #e2e8f0;
    --tc-shadow: 0 24px 60px rgba(15, 23, 42, .1);
    --tc-radius: 16px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--tc-text); background: var(--tc-background); font-family: inherit; line-height: 1.55; }
a { color: var(--tc-primary); }
.container { max-width: 1180px; }
.btn { border-radius: 9px; font-weight: 700; }
.btn-primary { --bs-btn-bg: var(--tc-primary); --bs-btn-border-color: var(--tc-primary); --bs-btn-hover-bg: var(--tc-primary-dark); --bs-btn-hover-border-color: var(--tc-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--tc-primary); --bs-btn-border-color: #bfdbfe; --bs-btn-hover-bg: var(--tc-primary); --bs-btn-hover-border-color: var(--tc-primary); }
.btn-lg { padding: .82rem 1.25rem; font-size: 1rem; }
.tc-brand { display: inline-flex; align-items: center; color: var(--tc-primary); font-size: 1.55rem; font-weight: 800; letter-spacing: -.045em; line-height: 1; text-decoration: none; }
.tc-brand span { color: var(--tc-text); }
.tc-brand-logo { display: block; flex: none; width: 28px; height: 28px; margin-right: 9px; }

.site-header { border-bottom: 1px solid rgba(226,232,240,.85); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.site-header .navbar { min-height: 76px; }
.site-header .nav-link { margin: 0 .45rem; color: #334155; font-size: .94rem; font-weight: 600; }
.site-header .nav-link:hover { color: var(--tc-primary); }
.navbar-toggler { display: flex; width: 42px; height: 42px; flex-direction: column; justify-content: center; gap: 5px; border: 1px solid var(--tc-border); border-radius: 9px; padding: 9px; }
.navbar-toggler:focus { box-shadow: 0 0 0 3px #dbeafe; }
.navbar-toggler span { display: block; width: 100%; height: 2px; background: var(--tc-text); }

.hero-section { overflow: hidden; padding: clamp(70px, 9vw, 120px) 0; background: radial-gradient(circle at 86% 18%, #dbeafe 0, transparent 32%), linear-gradient(180deg, #fff 0%, #f8fbff 100%); }
.section-kicker { display: inline-block; color: var(--tc-primary); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.hero-section h1 { margin: 16px 0 22px; font-size: clamp(2.7rem, 5.5vw, 5rem); font-weight: 800; letter-spacing: -.065em; line-height: .98; }
.hero-section h1 span { color: var(--tc-primary); }
.hero-lead { max-width: 620px; color: var(--tc-muted); font-size: clamp(1.08rem, 1.6vw, 1.27rem); }
.hero-actions { margin-top: 30px; }
.hero-actions .btn-link { color: #334155; text-decoration: none; }
.hero-actions .btn-link:hover { color: var(--tc-primary); }
.hero-notes { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; color: #475569; font-size: .88rem; font-weight: 600; }
.hero-notes i { display: inline-grid; width: 18px; height: 18px; margin-right: 5px; place-items: center; border-radius: 50%; color: var(--tc-accent); background: #ccfbf1; font-size: .7rem; font-style: normal; }

.product-preview { min-width: 620px; overflow: hidden; border: 1px solid #dbe3ef; border-radius: 20px; background: white; box-shadow: var(--tc-shadow); transform: rotate(1deg); }
.preview-topbar { display: flex; height: 58px; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--tc-border); }
.preview-brand { color: var(--tc-primary); font-weight: 800; letter-spacing: -.04em; }
.preview-brand span { color: var(--tc-text); }
.preview-user { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#bfdbfe,#2563eb); }
.preview-body { display: grid; min-height: 410px; grid-template-columns: 64px 1fr; }
.preview-sidebar { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 30px; border-right: 1px solid var(--tc-border); background: #f8fafc; }
.preview-sidebar i { width: 20px; height: 20px; border-radius: 5px; background: #cbd5e1; }
.preview-sidebar i.active { background: var(--tc-primary); box-shadow: 0 0 0 8px #dbeafe; }
.preview-content { padding: 34px; }
.preview-content small, .preview-content strong { display: block; }
.preview-content small { color: #64748b; font-size: .69rem; }
.preview-content strong { font-size: 1.25rem; }
.preview-button { padding: 9px 12px; border-radius: 7px; color: white; background: var(--tc-primary); font-size: .7rem; font-weight: 700; }
.preview-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.preview-stats div { padding: 16px; border: 1px solid var(--tc-border); border-radius: 10px; }
.preview-stats b { display: block; font-size: 1.4rem; }
.preview-list { margin-top: 20px; border: 1px solid var(--tc-border); border-radius: 10px; }
.preview-list > div { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--tc-border); }
.preview-list > div:last-child { border: 0; }
.preview-list time { color: #475569; font-size: .75rem; font-weight: 700; }
.preview-list b { display: block; font-size: .78rem; }
.preview-list em { padding: 5px 8px; border-radius: 999px; color: #166534; background: #dcfce7; font-size: .58rem; font-style: normal; font-weight: 700; }
.preview-list em.waiting { color: #92400e; background: #fef3c7; }

.section-space { padding: clamp(70px, 9vw, 110px) 0; }
.section-heading { max-width: 680px; margin-bottom: 44px; }
.section-heading h2, .flow-section h2, .privacy-panel h2, .plan-card h2, .final-cta h2 { margin: 12px 0 16px; font-size: clamp(2rem, 3.6vw, 3.2rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.08; }
.section-heading p, .section-copy { color: var(--tc-muted); font-size: 1.06rem; }
.feature-card { padding: 30px; border: 1px solid var(--tc-border); border-radius: var(--tc-radius); background: white; transition: transform .2s, box-shadow .2s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(15,23,42,.07); }
.feature-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 12px; color: var(--tc-primary); background: var(--tc-primary-soft); font-size: 1.25rem; font-weight: 800; }
.icon-calendar::before { content: "▦"; }.icon-patients::before { content: "◎"; }.icon-record::before { content: "≡"; }.icon-finance::before { content: "$"; }.icon-fiscal::before { content: "#"; }.icon-export::before { content: "↓"; }
.feature-card h3 { margin: 22px 0 10px; font-size: 1.12rem; font-weight: 800; }
.feature-card p { margin: 0; color: var(--tc-muted); font-size: .94rem; }
.signed-feature { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 22px; margin-top: 24px; padding: 25px 28px; border: 1px solid #99f6e4; border-radius: var(--tc-radius); background: linear-gradient(135deg,#f0fdfa,#f8fbff); }
.signed-feature-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 15px; color: #fff; background: var(--tc-accent); font-size: 1rem; font-weight: 900; box-shadow: 0 10px 22px rgba(15,118,110,.2); }
.signed-feature .section-kicker { color: var(--tc-accent); }
.signed-feature h3 { margin: 5px 0 5px; font-size: 1.18rem; font-weight: 800; }
.signed-feature p { max-width: 690px; margin: 0; color: var(--tc-muted); font-size: .9rem; }
.signed-feature-note { max-width: 210px; padding: 8px 11px; border-radius: 8px; color: #115e59; background: #ccfbf1; font-size: .72rem; font-weight: 700; line-height: 1.4; }

.flow-section { border-block: 1px solid var(--tc-border); background: #fff; }
.workflow-list { margin: 0; padding: 0; list-style: none; }
.workflow-list li { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--tc-border); }
.workflow-list li:last-child { border: 0; }
.workflow-list > li > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; color: white; background: var(--tc-primary); font-weight: 800; }
.workflow-list strong { font-size: 1.08rem; }
.workflow-list p { margin: 4px 0 0; color: var(--tc-muted); }
.privacy-section { padding-top: 70px; padding-bottom: 30px; }
.privacy-panel { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 28px; padding: clamp(28px,5vw,52px); border-radius: 22px; color: white; background: #0f172a; }
.privacy-panel .section-kicker { color: #93c5fd; }
.privacy-panel h2 { margin-top: 8px; font-size: clamp(1.7rem,3vw,2.5rem); }
.privacy-panel p { max-width: 720px; margin: 0; color: #cbd5e1; }
.privacy-panel a { color: white; white-space: nowrap; font-weight: 700; text-decoration: none; }
.privacy-symbol { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 18px; color: #0f766e; background: #ccfbf1; font-size: 1.5rem; font-weight: 900; }
.plan-section { padding-top: 50px; }
.plan-card { display: grid; grid-template-columns: 1.4fr 1fr auto; align-items: center; gap: 42px; padding: clamp(30px,5vw,58px); border: 1px solid #bfdbfe; border-radius: 22px; background: linear-gradient(135deg,#eff6ff,#fff); }
.plan-card h2 { margin-top: 8px; font-size: clamp(1.8rem,3vw,2.6rem); }
.plan-card p { margin: 0; color: var(--tc-muted); }
.plan-card ul { margin: 0; padding: 0; list-style: none; }
.plan-card li { margin: 10px 0; padding-left: 24px; position: relative; }
.plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--tc-accent); font-weight: 900; }
.faq-wrap { max-width: 850px; }
.faq-list { border-top: 1px solid var(--tc-border); }
.faq-list details { border-bottom: 1px solid var(--tc-border); background: white; }
.faq-list summary { padding: 23px 8px; cursor: pointer; font-weight: 750; list-style: none; }
.faq-list summary::after { content: "+"; float: right; color: var(--tc-primary); font-size: 1.4rem; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { padding: 0 8px 22px; margin: 0; color: var(--tc-muted); }
.final-cta { padding: 78px 0; color: white; background: var(--tc-primary); }
.final-cta h2 { margin-top: 0; }
.final-cta p { margin-bottom: 25px; color: #dbeafe; font-size: 1.1rem; }
.final-cta .btn { color: var(--tc-primary); }
.site-footer { padding: 48px 0 28px; border-top: 1px solid var(--tc-border); background: white; }
.footer-top, .footer-bottom { display: flex; justify-content: space-between; gap: 25px; }
.footer-top p { margin: 12px 0 0; color: var(--tc-muted); }
.footer-top nav { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 18px; }
.footer-top nav a, .footer-bottom { color: #64748b; font-size: .86rem; text-decoration: none; }
.footer-bottom { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--tc-border); }
.cookie-preferences { border: 0; padding: 0; color: inherit; background: transparent; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.cookie-preferences:hover { color: var(--tc-primary); }
.cookie-banner { position: fixed; z-index: 2100; bottom: 20px; left: 50%; display: flex; width: min(760px,calc(100% - 32px)); align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px; border: 1px solid #bfdbfe; border-radius: 16px; background: white; box-shadow: var(--tc-shadow); transform: translateX(-50%); }
.cookie-banner[hidden] { display: none; }
.cookie-banner strong { display: block; font-size: 1rem; }
.cookie-banner p { margin: 6px 0; color: var(--tc-muted); font-size: .88rem; }
.cookie-banner a { font-size: .84rem; font-weight: 650; }
.cookie-actions { display: flex; flex: 0 0 auto; gap: 9px; }
.cookie-actions .btn { min-width: 90px; }

.flash-container { position: fixed; z-index: 2000; top: 16px; right: 16px; width: min(420px,calc(100% - 32px)); }
.flash { margin-bottom: 8px; padding: 13px 16px; border: 1px solid var(--tc-border); border-radius: 10px; background: white; box-shadow: 0 12px 32px rgba(15,23,42,.12); }
.flash-success { color: #166534; background: #f0fdf4; }.flash-info { color: #1e40af; background: #eff6ff; }.flash-warning { color: #92400e; background: #fffbeb; }.flash-danger { color: #991b1b; background: #fef2f2; }
.flash { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.flash-dismiss { flex: 0 0 auto; width: 25px; height: 25px; border: 0; border-radius: 5px; color: inherit; background: transparent; font-size: 1.3rem; line-height: 1; }
.flash-dismiss:hover, .flash-dismiss:focus-visible { background: rgba(15,23,42,.08); }

/* Authentication */
.auth-page { background: linear-gradient(135deg,#f8fafc 0%,#eff6ff 100%); }
.auth-shell { display: flex; min-height: 100vh; flex-direction: column; }
.auth-header { display: flex; width: min(100% - 40px,1180px); margin: 0 auto; padding: 26px 0; align-items: center; justify-content: space-between; }
.auth-header > a:last-child { color: #475569; font-size: .9rem; font-weight: 650; text-decoration: none; }
.auth-main { display: grid; flex: 1; place-items: center; padding: 24px 20px 50px; }
.auth-card { width: min(100%,450px); padding: clamp(25px,5vw,38px); border: 1px solid var(--tc-border); border-radius: 18px; background: white; box-shadow: 0 22px 60px rgba(15,23,42,.08); }
.auth-card-wide { width: min(100%,700px); }
.auth-card-heading { margin-bottom: 28px; }
.auth-card h1 { margin: 9px 0 8px; font-size: clamp(1.75rem,4vw,2.25rem); font-weight: 800; letter-spacing: -.04em; }
.auth-card-heading p, .auth-result > p { margin: 0; color: var(--tc-muted); }
.form-label { margin-bottom: 7px; color: #334155; font-size: .88rem; font-weight: 700; }
.form-control, .form-select { min-height: 48px; border-color: #cbd5e1; border-radius: 9px; font-size: .96rem; }
.form-control:focus, .form-select:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px #dbeafe; }
.form-section-title { margin-bottom: 14px; color: var(--tc-text); font-size: .95rem; font-weight: 800; }
.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 22px; padding: 0; border: 0; }
.role-selector legend { grid-column: 1/-1; margin-bottom: 5px; font-size: .8rem; font-weight: 700; }
.role-selector label { cursor: pointer; }
.role-selector input { position: absolute; opacity: 0; }
.role-selector span { display: block; padding: 10px; border: 1px solid var(--tc-border); border-radius: 8px; text-align: center; font-size: .9rem; font-weight: 700; }
.role-selector input:checked + span { border-color: var(--tc-primary); color: var(--tc-primary); background: var(--tc-primary-soft); }
.role-selector input:focus-visible + span { outline: 3px solid #93c5fd; outline-offset: 2px; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 74px; }
.password-field button { position: absolute; top: 50%; right: 10px; border: 0; color: var(--tc-primary); background: none; font-size: .75rem; font-weight: 750; transform: translateY(-50%); }
.form-link { color: var(--tc-primary); font-size: .82rem; font-weight: 650; text-decoration: none; }
.recaptcha-wrap:empty { display: none; }.recaptcha-wrap:not(:empty) { margin: 20px 0; }
.field-error { margin: 6px 0 0; color: #b91c1c; font-size: .8rem; }
.form-alert { margin-bottom: 20px; padding: 12px 14px; border: 1px solid #fecaca; border-radius: 9px; color: #991b1b; background: #fef2f2; font-size: .88rem; }
.form-alert-success { border-color: #bbf7d0; color: #166534; background: #f0fdf4; }
.form-alert-warning { border-color: #fcd34d; color: #78350f; background: #fffbeb; }
.form-alert strong, .form-alert span { display: block; }
.form-alert strong { font-size: .92rem; }
.form-alert span { margin-top: 4px; line-height: 1.55; }
.form-alert a { color: inherit; font-weight: 750; text-underline-offset: 2px; }
.auth-switch, .auth-help { margin: 24px 0 0; color: var(--tc-muted); text-align: center; font-size: .88rem; }
.auth-switch a, .auth-help a { font-weight: 700; text-decoration: none; }
.legal-check { display: flex; gap: 10px; margin-bottom: 22px; color: #475569; font-size: .84rem; line-height: 1.45; }
.legal-check input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--tc-primary); }
.auth-footer { display: flex; justify-content: center; gap: 20px; padding: 24px; }
.auth-footer a { color: #64748b; font-size: .78rem; text-decoration: none; }
.result-icon { display: grid; width: 60px; height: 60px; margin: 0 auto 20px; place-items: center; border-radius: 50%; color: #166534; background: #dcfce7; font-size: 1.5rem; font-weight: 900; }
.result-icon-error { color: #991b1b; background: #fee2e2; }
.auth-result .btn { margin-top: 24px; }
.auth-result .result-hint { margin-top: 12px; font-size: .85rem; }
.auth-result .auth-help { margin-top: 18px; }
.auth-result .form-alert { margin-top: 20px; }

/* Legal */
.legal-page { background: #fff; }
.legal-header { border-bottom: 1px solid var(--tc-border); background: white; }
.legal-header .container, .legal-footer .container { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 25px; }
.legal-header nav, .legal-footer nav { display: flex; gap: 20px; }
.legal-header nav a, .legal-footer a { color: #475569; font-size: .86rem; font-weight: 650; text-decoration: none; }
.legal-main { padding: 50px 0 90px; background: linear-gradient(180deg,#f8fafc 0,#fff 280px); }
.legal-container { max-width: 900px; }
.legal-back { display: inline-block; margin-bottom: 25px; color: #475569; font-size: .86rem; text-decoration: none; }
.legal-document > header { padding: 40px; border: 1px solid var(--tc-border); border-radius: 16px; background: white; }
.legal-document h1, .legal-hub h1 { margin: 10px 0 14px; font-size: clamp(2.2rem,5vw,3.5rem); font-weight: 800; letter-spacing: -.05em; }
.legal-document > header > p, .legal-hub-heading > p { color: var(--tc-muted); font-size: 1.05rem; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 25px; color: #64748b; font-size: .8rem; }
.legal-summary { display: flex; flex-wrap: wrap; gap: 9px 18px; margin: 32px 0 10px; padding: 18px; border-radius: 12px; background: #f8fafc; }
.legal-summary strong { width: 100%; font-size: .83rem; }
.legal-summary a { font-size: .84rem; text-decoration: none; }
.legal-document section { padding-top: 30px; }
.legal-document section h2 { margin: 0 0 12px; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.legal-document section p, .legal-document section li { color: #3f4d61; line-height: 1.75; }
.legal-document section li { margin-bottom: 8px; }
.legal-table-wrap { overflow-x: auto; }
.legal-table-wrap table { width: 100%; border-collapse: collapse; }
.legal-table-wrap th, .legal-table-wrap td { padding: 13px; border: 1px solid var(--tc-border); text-align: left; font-size: .87rem; }
.legal-table-wrap th { background: #f8fafc; }
.privacy-contact a { font-size: 1.15rem; font-weight: 800; }
.legal-footer { border-top: 1px solid var(--tc-border); background: #f8fafc; color: #64748b; font-size: .82rem; }
.legal-hub { min-height: calc(100vh - 145px); padding: 75px 0 100px; background: linear-gradient(180deg,#f8fafc,#fff); }
.legal-hub-heading { max-width: 760px; margin-bottom: 46px; }
.legal-cards > div > a { display: block; height: 100%; padding: 28px; border: 1px solid var(--tc-border); border-radius: 15px; color: inherit; background: white; text-decoration: none; transition: .2s; }
.legal-cards > div > a:hover { border-color: #93c5fd; transform: translateY(-2px); box-shadow: 0 16px 35px rgba(15,23,42,.06); }
.legal-cards span { color: var(--tc-primary); font-size: .76rem; font-weight: 800; }
.legal-cards h2 { margin: 12px 0 8px; font-size: 1.2rem; font-weight: 800; }
.legal-cards p { min-height: 48px; color: var(--tc-muted); font-size: .9rem; }
.legal-cards b { color: var(--tc-primary); font-size: .83rem; }

@media (max-width: 991.98px) {
    .site-header .navbar { position: relative; }
    .site-header .navbar-collapse { position: absolute; top: 100%; right: 0; left: 0; max-height: calc(100vh - 76px); overflow-y: auto; padding: 16px 20px 20px; border-top: 1px solid var(--tc-border); border-bottom: 1px solid var(--tc-border); background: #fff; box-shadow: 0 16px 28px rgba(15,23,42,.1); }
    .site-header .nav-link { margin: 3px 0; padding: 9px 0; }
    .site-actions { margin-top: 12px; }
    .site-actions .btn { flex: 1; }
    .product-preview { min-width: 0; transform: none; }
    .privacy-panel, .plan-card { grid-template-columns: 1fr; }
    .signed-feature { grid-template-columns: 62px 1fr; }
    .signed-feature-note { grid-column: 2; max-width: none; }
    .privacy-panel a { white-space: normal; }
}

@media (max-width: 767.98px) {
    .cookie-banner { bottom: 12px; align-items: stretch; flex-direction: column; gap: 14px; padding: 18px; }
    .cookie-actions .btn { flex: 1; }
    .hero-section { padding-top: 58px; }
    .preview-body { grid-template-columns: 42px 1fr; min-height: 350px; }
    .preview-content { padding: 20px 14px; }
    .preview-sidebar { gap: 18px; }
    .preview-sidebar i { width: 15px; height: 15px; }
    .preview-stats div { padding: 10px; }.preview-stats b { font-size: 1rem; }
    .preview-list em { display: none; }.preview-list > div { grid-template-columns: 46px 1fr; }
    .privacy-symbol { width: 50px; height: 50px; }
    .signed-feature { grid-template-columns: 1fr; padding: 23px 20px; }
    .signed-feature-note { grid-column: 1; }
    .footer-top, .footer-bottom { flex-direction: column; }
    .footer-top nav { justify-content: flex-start; }
    .auth-header { width: calc(100% - 32px); }
    .auth-main { padding-inline: 10px; }
    .auth-card { padding: 24px 18px; border-radius: 14px; }
    .legal-header nav a:first-child { display: none; }
    .legal-document > header { padding: 28px 20px; }
    .legal-footer .container { align-items: flex-start; flex-direction: column; padding-block: 22px; }
    .legal-footer nav { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *,*::before,*::after { transition: none !important; } }
