:root {
    --navy-deep: #0A1420;
    --navy: #14233B;
    --navy-mid: #1F2F4A;
    --gold: #C7A05B;
    --gold-line: #8B6F3F;
    --gold-light: #E7E2D8;
    --cream: #F5F1E8;
    --white: #FBFAF7;
    --gray: #6B7280;
    --gray-light: #AAB3C3;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Montserrat', Helvetica, Arial, sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--navy);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

h1, h2, h3, .display {
    font-family: var(--font-display);
    color: var(--navy);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin: 0;
}

a { color: var(--navy); }

.container { max-width: 1160px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 640px; margin: 0 auto; padding: 0 24px; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.7s var(--ease) both; }
.fade-up-1 { animation-delay: 0.05s; }
.fade-up-2 { animation-delay: 0.15s; }
.fade-up-3 { animation-delay: 0.25s; }
.fade-up-4 { animation-delay: 0.35s; }
@media (prefers-reduced-motion: reduce) {
    .fade-up, .fade-up-1, .fade-up-2, .fade-up-3, .fade-up-4 { animation: none; }
}

/* ---------- Rank bars -- the signature device ---------- */
.rank-bars { display: inline-flex; gap: 4px; align-items: center; }
.rank-bars .bar { width: 18px; height: 3px; background: var(--gold); }
.rank-bars.dim .bar { background: rgba(199, 160, 91, 0.28); }
.rank-bars.on-dark .bar { background: var(--gold); }

/* ---------- Top nav ---------- */
.topbar {
    background: var(--navy);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 10;
}
.topbar .brand {
    font-family: var(--font-display);
    color: var(--white);
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    text-decoration: none;
}
.topbar .brand .accent { color: var(--gold); }
.topbar a.nav-link {
    color: var(--gold-light);
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 24px;
    transition: color 0.2s var(--ease);
}
.topbar a.nav-link:hover { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: 3px;
    padding: 14px 26px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(20, 35, 59, 0.18); }
.btn:active { transform: translateY(0); }
.btn.full { width: 100%; margin-top: 24px; }
.btn.gold { background: var(--gold); color: var(--navy-deep); }
.btn.gold:hover { background: #D4B06E; box-shadow: 0 8px 20px rgba(199, 160, 91, 0.35); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--gray-light); }
.btn.ghost:hover { border-color: var(--navy); box-shadow: none; }
.btn.ghost-dark { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.3); }
.btn.ghost-dark:hover { border-color: var(--gold); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---------- Cards / auth forms ---------- */
.auth-shell {
    min-height: calc(100vh - 73px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background:
        radial-gradient(ellipse 900px 500px at 15% -10%, rgba(199,160,91,0.06), transparent),
        var(--cream);
}
.card {
    background: var(--white);
    border: 1px solid var(--gold-light);
    border-radius: 6px;
    padding: 44px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 4px 32px rgba(20, 35, 59, 0.07);
}
.card h1 { font-size: 1.7rem; margin: 0 0 8px; }
.card .subtitle { color: var(--gray); font-size: 0.93rem; margin-bottom: 30px; line-height: 1.6; }

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--navy);
    margin: 18px 0 7px;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
textarea, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--white);
    color: var(--navy);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(199, 160, 91, 0.16);
}

.form-footer {
    margin-top: 22px;
    font-size: 0.88rem;
    color: var(--gray);
    text-align: center;
}

.error-banner {
    background: #FCEBEA;
    border: 1px solid #E8A6A0;
    color: #8B2F27;
    padding: 11px 15px;
    border-radius: 4px;
    font-size: 0.88rem;
    margin-bottom: 18px;
    display: none;
}
.error-banner.show { display: block; }

/* ---------- Legal review (signup step 2) ---------- */
.legal-doc {
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    padding: 18px 20px;
    max-height: 220px;
    overflow-y: auto;
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--navy);
    white-space: pre-wrap;
    background: var(--cream);
    margin-bottom: 14px;
}
.legal-check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    font-size: 0.88rem;
    color: var(--navy);
    line-height: 1.5;
}
.legal-check-row input[type="checkbox"] {
    width: 17px; height: 17px; margin-top: 2px; flex-shrink: 0; accent-color: var(--gold);
}

/* ---------- Landing ---------- */
.hero-split {
    background: var(--navy-deep);
    position: relative;
    overflow: hidden;
    padding: 90px 0 100px;
}
.hero-ring {
    position: absolute;
    border: 1px solid rgba(199, 160, 91, 0.16);
    border-radius: 50%;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}
.hero-eyebrow {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.hero-split h1 {
    color: var(--white);
    font-size: 3.4rem;
    margin-bottom: 22px;
}
.hero-split h1 em { color: var(--gold); font-style: italic; }
.hero-split p.lead {
    color: var(--gray-light);
    font-size: 1.12rem;
    line-height: 1.65;
    max-width: 480px;
    margin-bottom: 34px;
}
.hero-features {
    list-style: none;
    padding: 0;
    margin: 0 0 38px;
    display: grid;
    gap: 12px;
}
.hero-features li {
    color: var(--gold-light);
    font-size: 0.95rem;
    padding-left: 22px;
    position: relative;
}
.hero-features li::before {
    content: '';
    position: absolute;
    left: 0; top: 9px;
    width: 10px; height: 1.5px;
    background: var(--gold);
}
.hero-cta-row { display: flex; gap: 14px; }

.ladder-panel { position: relative; padding: 20px; }
.ladder-step {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(199,160,91,0.22);
    border-radius: 4px;
    padding: 22px 26px;
    margin-bottom: 16px;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.ladder-step:hover { transform: translateX(6px); border-color: rgba(199,160,91,0.5); }
.ladder-step:nth-child(2) { margin-left: 28px; }
.ladder-step:nth-child(3) { margin-left: 56px; margin-bottom: 0; }
.ladder-step .lvl { color: var(--gray-light); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; display: block; }
.ladder-step .name { font-family: var(--font-display); color: var(--white); font-size: 1.25rem; margin-bottom: 8px; }

.process-section { background: var(--cream); padding: 100px 0; }
.section-heading { text-align: center; margin-bottom: 64px; }
.section-heading .hero-eyebrow { justify-content: center; }
.section-heading h2 { font-size: 2.2rem; }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.process-step { position: relative; }
.process-num { font-family: var(--font-display); font-size: 2.6rem; color: var(--gold); opacity: 0.5; margin-bottom: 12px; line-height: 1; }
.process-step h3 { font-size: 1.05rem; margin-bottom: 10px; }
.process-step p { color: var(--gray); font-size: 0.9rem; line-height: 1.6; margin: 0; }

.tier-preview-section { background: var(--navy); padding: 100px 0; }
.tier-preview-section .section-heading h2 { color: var(--white); }
.tier-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tier-preview-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(199,160,91,0.2);
    border-radius: 6px;
    padding: 30px;
    text-decoration: none;
    display: block;
    transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.tier-preview-card:hover { transform: translateY(-4px); border-color: var(--gold); background: rgba(255,255,255,0.05); }
.tier-preview-card .rank-bars { margin-bottom: 16px; }
.tier-preview-card h3 { font-family: var(--font-display); color: var(--white); font-size: 1.3rem; margin-bottom: 10px; }
.tier-preview-card p { color: var(--gray-light); font-size: 0.87rem; line-height: 1.6; margin: 0 0 16px; }
.tier-preview-card .cta { color: var(--gold); font-size: 0.82rem; font-weight: 600; }

.site-footer { background: var(--navy-deep); padding: 40px 0; text-align: center; border-top: 1px solid rgba(199,160,91,0.12); }
.site-footer p { color: var(--gray-light); font-size: 0.82rem; margin: 0; }

@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-split h1 { font-size: 2.3rem; }
    .process-grid { grid-template-columns: repeat(2, 1fr); }
    .tier-preview-grid { grid-template-columns: 1fr; }
    .ladder-step:nth-child(2) { margin-left: 14px; }
    .ladder-step:nth-child(3) { margin-left: 28px; }
}

/* ---------- Pricing ---------- */
.pricing-hero { background: var(--navy-deep); padding: 80px 0 60px; text-align: center; }
.pricing-hero h1 { color: var(--white); font-size: 2.6rem; }
.pricing-hero .hero-eyebrow { justify-content: center; }
.pricing-grid-wrap { background: var(--cream); padding: 0 0 100px; margin-top: -40px; }
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
}
.pricing-card {
    background: var(--white);
    border: 1px solid var(--gold-light);
    border-radius: 6px;
    padding: 38px 34px;
    box-shadow: 0 12px 40px rgba(20,35,59,0.08);
    position: relative;
    transition: transform 0.25s var(--ease);
}
.pricing-card:hover { transform: translateY(-6px); }
.pricing-card.featured { border: 2px solid var(--gold); }
.pricing-card .popular-tag {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    background: var(--gold); color: var(--navy-deep);
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    padding: 5px 16px; border-radius: 12px;
}
.pricing-card .rank-bars { margin-bottom: 18px; }
.pricing-card h3 { font-size: 1.5rem; margin-bottom: 14px; }
.pricing-card .desc { color: var(--gray); font-size: 0.9rem; line-height: 1.6; margin-bottom: 22px; }
.pricing-card ul { list-style: none; padding: 0; margin: 0 0 28px; }
.pricing-card li { font-size: 0.89rem; color: var(--navy); padding: 9px 0 9px 24px; position: relative; border-top: 1px solid var(--gold-light); }
.pricing-card li:first-child { border-top: none; }
.pricing-card li::before { content: ''; position: absolute; left: 0; top: 17px; width: 10px; height: 1.5px; background: var(--gold); }

/* ---------- Chat / dashboard ---------- */
.tier-tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--white); border-bottom: 1px solid var(--gold-light); }
.tier-tab {
    padding: 16px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tier-tab.active { color: var(--navy); border-bottom-color: var(--gold); }
.tier-tab:hover:not(.active) { color: var(--navy); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.35s var(--ease) both; }

.chat-layout { display: flex; }
.chat-sidebar { width: 264px; background: var(--navy-deep); padding: 22px 16px; overflow-y: auto; flex-shrink: 0; }
.chat-sidebar .tier-badge {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 20px;
    background: rgba(199,160,91,0.08); border: 1px solid rgba(199,160,91,0.2); border-radius: 4px;
}
.chat-sidebar .tier-badge .tier-name { color: var(--gold-light); font-size: 0.78rem; font-weight: 600; }
.chat-sidebar .new-convo {
    width: 100%; background: var(--gold); color: var(--navy-deep); border: none; border-radius: 4px;
    padding: 12px; font-weight: 600; font-family: var(--font-body); cursor: pointer; margin-bottom: 20px;
    transition: transform 0.2s var(--ease);
}
.chat-sidebar .new-convo:hover { transform: translateY(-1px); }
.convo-item {
    color: var(--gold-light); padding: 11px 12px; border-radius: 4px; font-size: 0.87rem; cursor: pointer;
    margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background 0.2s var(--ease);
}
.convo-item:hover, .convo-item.active { background: rgba(255,255,255,0.07); }

.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--white); overflow-y: auto; min-width: 0; }
.chat-main .tab-panel.active { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-main .tab-panel:not(#panel-chat).active { display: block; overflow-y: auto; }
.chat-panel-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 36px 24px; }
.chat-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--gray); text-align: center; padding: 0 40px; }
.chat-empty h2 { color: var(--navy); margin-bottom: 8px; font-size: 1.3rem; }

.msg-row { max-width: 700px; margin: 0 auto 22px; display: flex; }
.msg-row.user { justify-content: flex-end; }
.msg-bubble { padding: 14px 18px; border-radius: 10px; font-size: 0.95rem; line-height: 1.6; white-space: pre-wrap; }
.msg-row.user .msg-bubble { background: var(--navy); color: var(--white); border-bottom-right-radius: 3px; max-width: 480px; }
.msg-row.assistant .msg-bubble { background: var(--gold-light); color: var(--navy); border-bottom-left-radius: 3px; max-width: 560px; }
.msg-row.assistant .msg-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--gold-line); font-weight: 700; margin-bottom: 6px; display: block; }

.chat-input-bar { border-top: 1px solid var(--gold-light); padding: 20px 24px; display: flex; gap: 12px; max-width: 748px; width: 100%; margin: 0 auto; }
.chat-input-bar textarea { flex: 1; min-height: 50px; max-height: 160px; }
.chat-input-bar .btn { align-self: flex-end; }

.typing-indicator { color: var(--gray); font-size: 0.85rem; font-style: italic; padding: 0 0 12px; max-width: 700px; margin: 0 auto; }

/* ---------- Intake ---------- */
.intake-progress { display: flex; gap: 6px; margin-bottom: 30px; }
.intake-progress .dot { flex: 1; height: 3px; background: var(--gold-light); border-radius: 2px; transition: background 0.3s var(--ease); }
.intake-progress .dot.done { background: var(--gold); }
.section-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.11em; color: var(--gold-line); font-weight: 700; margin-bottom: 5px; }
.helper-text { color: var(--gray); font-size: 0.85rem; margin-top: 5px; }
.intake-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }

/* ---------- Command Center ---------- */
.cc-wrap { max-width: 780px; margin: 0 auto; padding: 32px 24px; }
.cc-add-row { display: flex; gap: 10px; margin-bottom: 22px; }
.cc-add-row input[type="text"] { flex: 1; }
.task-row {
    display: grid; grid-template-columns: 1fr 130px 130px 100px 32px; gap: 10px; align-items: center;
    background: var(--white); border: 1px solid var(--gold-light); border-radius: 5px; padding: 11px 14px;
    margin-bottom: 8px; transition: border-color 0.2s var(--ease);
}
.task-row:hover { border-color: var(--gray-light); }
.task-row input[type="text"], .task-row select, .task-row input[type="date"] { padding: 7px 9px; font-size: 0.85rem; }
.task-row .task-delete { color: var(--gray); cursor: pointer; text-align: center; font-size: 1.1rem; transition: color 0.2s var(--ease); }
.task-row .task-delete:hover { color: #A32D2D; }
.status-badge { font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.status-badge.not_started { background: var(--gold-light); color: var(--gray); }
.status-badge.in_progress { background: #FAEEDA; color: #854F0B; }
.status-badge.done { background: #EAF3DE; color: #3B6D11; }

.toolkit-section { background: var(--white); border: 1px solid var(--gold-light); border-radius: 6px; padding: 22px 26px; margin-bottom: 16px; }
.toolkit-section h3 { font-size: 1rem; margin: 0 0 10px; }
.toolkit-section .content { font-size: 0.87rem; line-height: 1.7; color: var(--navy); white-space: pre-wrap; }
.toolkit-toggle { color: var(--gold-line); font-size: 0.8rem; font-weight: 600; cursor: pointer; }

.session-card { background: var(--white); border: 1px solid var(--gold-light); border-radius: 6px; padding: 22px 26px; margin-bottom: 14px; }
.session-card .session-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.session-card h3 { font-size: 1.05rem; margin: 0; }
.session-status { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: 10px; }
.session-status.scheduled { background: #E6F1FB; color: #0C447C; }
.session-status.completed { background: #EAF3DE; color: #3B6D11; }
.session-status.cancelled { background: #FCEBEA; color: #8B2F27; }
.session-field { margin-top: 10px; }
.session-field .field-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold-line); font-weight: 700; margin-bottom: 4px; }
.session-field .field-body { font-size: 0.88rem; color: var(--navy); line-height: 1.6; white-space: pre-wrap; }
.empty-state { text-align: center; color: var(--gray); padding: 60px 20px; }

@media (max-width: 720px) {
    .chat-layout { flex-direction: column; }
    .chat-sidebar { width: 100%; max-height: 200px; }
    .task-row { grid-template-columns: 1fr; gap: 6px; }
}
