/* Shared styles for member app pages (dashboard, rewards). Tokens match style.css. */
:root {
    /* Palette — same tokens as style.css (homepage) */
    --cream: #F5F1E8;
    --paper: #FBF8F2;
    --beige: #E8DCC4;
    --tan: #C9B59A;
    --gold: #B8936D;
    --gold-dark: #9A7A58;
    --espresso: #5C4A3A;
    --espresso-deep: #3D3024;
    --warm-brown: #8B7355;
    --ink: #2A2018;
    --line: rgba(184, 147, 109, 0.32);
    /* Older names still used by inline styles set from JS */
    --dark-brown: var(--espresso);
    --brown: var(--warm-brown);
    --success: #5A7A5C;
    --pending: #A87B3C;
    --error: #A4473B;

    --serif: "Cormorant Garamond", "Gloock", Georgia, serif;
    --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* Cormorant's default old-style numerals dip below the line ("18,710") — use full-height figures */
html { font-variant-numeric: lining-nums; }
input[type="checkbox"] { accent-color: var(--gold); width: 15px; height: 15px; }
body {
    font-family: var(--sans);
    background: var(--cream);
    color: var(--espresso-deep);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; }
::selection { background: var(--gold); color: var(--cream); }
strong { font-weight: 600; color: var(--espresso-deep); }

/* Small uppercase label with a gold rule — the homepage "eyebrow" */
.eyebrow {
    font-size: 11px; font-weight: 500; letter-spacing: 0.32em; text-transform: uppercase;
    color: var(--gold); display: flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 32px; height: 1px; background: var(--gold); flex-shrink: 0; }
.label {
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--warm-brown);
}
.muted { color: var(--warm-brown); font-weight: 300; }
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(245, 241, 232, 0.9);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-content {
    max-width: 1180px; margin: 0 auto; padding: 14px 32px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { width: 34px; height: 34px; object-fit: contain; }
.logo span { font-family: var(--serif); font-size: 19px; letter-spacing: 0.14em; color: var(--espresso-deep); white-space: nowrap; }
.app-nav { display: flex; gap: 34px; }
.app-nav a {
    font-size: 11px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--espresso); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.app-nav a:hover { color: var(--gold); }
.app-nav a.active { color: var(--espresso-deep); border-bottom-color: var(--gold); }
.header-right { display: flex; align-items: center; gap: 18px; }
.session-indicator {
    display: none; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--warm-brown); white-space: nowrap;
}
.session-indicator .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--success); margin-right: 8px; vertical-align: middle; transform: translateY(-1px); }
.session-indicator.warn .dot { background: var(--pending); }
.session-indicator.urgent { color: var(--error); }
.session-indicator.urgent .dot { background: var(--error); }
.user-name { display: none; }
.logout-btn {
    font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
    padding: 9px 18px; background: transparent; color: var(--espresso-deep);
    border: 1px solid var(--espresso-deep); border-radius: 2px; cursor: pointer; transition: all .2s;
}
.logout-btn:hover { background: var(--espresso-deep); color: var(--cream); }
@media (max-width: 900px) { .app-nav { display: none; } }
@media (max-width: 560px) {
    .header-content { padding: 12px 16px; }
    .logo span { font-size: 16px; }
    .session-indicator { display: none !important; }
}

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 56px 32px 24px; }
@media (max-width: 560px) { .container { padding: 36px 16px 16px; } }

.welcome-section { margin-bottom: 44px; }
.welcome-section .eyebrow { margin-bottom: 20px; }
.welcome-title {
    font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6vw, 68px);
    line-height: 1; letter-spacing: -0.015em; color: var(--espresso-deep); margin-bottom: 14px;
}
.welcome-title em { font-style: italic; color: var(--gold); }
.welcome-subtitle { font-size: 15px; font-weight: 300; color: var(--warm-brown); }

/* Status strip — three facts divided by hairlines, no cards */
.stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 48px;
}
.stat-card { padding: 22px 24px 24px; border-left: 1px solid var(--line); }
.stat-card:first-child { border-left: none; padding-left: 0; }
.stat-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.stat-value { font-family: var(--serif); font-size: 30px; line-height: 1.1; color: var(--espresso-deep); }
.stat-value .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); margin-right: 12px; vertical-align: middle; transform: translateY(-3px); }
.stat-value.pending .dot { background: var(--pending); }
@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card, .stat-card:first-child { border-left: none; padding: 16px 0; border-top: 1px solid var(--line); }
    .stat-card:first-child { border-top: none; }
    .stat-value { font-size: 26px; }
}

/* ---------- Panels ---------- */
.info-card, .quick-links {
    background: var(--paper); border: 1px solid var(--line); border-radius: 2px;
    padding: 36px 40px; margin-bottom: 28px;
}
@media (max-width: 560px) { .info-card, .quick-links { padding: 26px 20px; } }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.panel-head .label { color: var(--gold); }
.info-card-title, .quick-links-title {
    font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 34px); line-height: 1.15;
    color: var(--espresso-deep); margin: 10px 0 8px;
}
.panel-intro { font-size: 14.5px; font-weight: 300; color: var(--warm-brown); line-height: 1.65; margin-bottom: 24px; max-width: 640px; }
.progress-note { font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--warm-brown); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin-bottom: 28px; }
.two-col > * { margin-bottom: 0; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* Buttons — square, uppercase, espresso (homepage .btn) */
.link-btn, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
    padding: 15px 26px; border-radius: 2px; border: 1px solid var(--espresso-deep);
    background: var(--espresso-deep); color: var(--cream); text-decoration: none; cursor: pointer;
    transition: background .25s, color .25s, transform .25s, box-shadow .25s; white-space: nowrap;
}
.link-btn:hover, .btn:hover { background: var(--ink); transform: translateY(-1px); box-shadow: 0 16px 32px -20px rgba(60,48,36,.55); }
.link-btn:disabled, .btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn-ghost { background: transparent; color: var(--espresso-deep); }
.btn-ghost:hover { background: var(--espresso-deep); color: var(--cream); }
.text-btn {
    background: none; border: none; cursor: pointer; font-family: var(--sans); font-size: 10.5px; font-weight: 600;
    letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); padding: 2px 0 2px 12px;
}
.text-btn:hover { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 4px; }
.field {
    flex: 1; min-width: 180px; padding: 13px 14px; border: 1px solid var(--tan); border-radius: 2px;
    font-family: var(--sans); font-size: 14px; background: var(--cream); color: var(--espresso-deep); outline: none;
}
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,147,109,.15); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.link-icon, .link-btn svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

/* ---------- Alerts (trial gate, pending, launch) ---------- */
.alert {
    background: var(--paper); border: 1px solid var(--line); border-left: 2px solid var(--pending);
    border-radius: 2px; padding: 28px 32px; margin-bottom: 28px; display: flex; gap: 18px;
}
#launchBanner { border-left-color: var(--gold); }
.alert-icon { display: none; }
.alert-content h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; color: var(--espresso-deep); margin-bottom: 8px; }
.alert-content p { color: var(--warm-brown); line-height: 1.7; font-weight: 300; font-size: 14.5px; }
.alert .link-btn { margin-top: 18px; }
#trialGate { border-left: 2px solid var(--gold); }

/* ---------- Getting started ---------- */
.gs-step { border-top: 1px solid var(--line); padding: 18px 0; }
.gs-step:first-of-type { border-top: none; }
.gs-head { display: flex; align-items: center; gap: 18px; }
.gs-num {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--gold);
    color: var(--gold); display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-style: italic; font-size: 17px;
}
.gs-step.done .gs-num { background: var(--gold); color: var(--cream); font-style: normal; font-size: 13px; }
.gs-title { flex: 1; font-family: var(--serif); font-size: 21px; color: var(--espresso-deep); }
.gs-step.done .gs-title { color: var(--warm-brown); }
.gs-state { font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--warm-brown); text-align: right; }
.gs-body { padding: 12px 0 0 48px; color: var(--warm-brown); font-size: 14px; font-weight: 300; line-height: 1.65; }
.gs-body p { margin-bottom: 12px; }
.gs-step.done .gs-body { display: none; }
.gs-handle { text-transform: none; letter-spacing: .02em; font-size: 13px; font-weight: 600; color: var(--espresso-deep); margin-left: 2px; }
.gs-fix { padding: 6px 0 0 48px; font-size: 13px; font-weight: 300; color: var(--warm-brown); }
.gs-fix .text-btn { padding-left: 4px; }
@media (max-width: 560px) {
    .gs-head { flex-wrap: wrap; row-gap: 4px; }
    .gs-state { width: 100%; text-align: left; padding-left: 48px; }
    .gs-body, .gs-fix { padding-left: 0; } .gs-title { font-size: 19px; }
}

/* ---------- Tutorials ---------- */
#tutSteps { border-top: 1px solid var(--line); }
.tut-step {
    display: flex; align-items: center; gap: 18px; width: 100%; text-align: left;
    padding: 16px 4px; background: none; border: none; border-bottom: 1px solid var(--line);
    cursor: pointer; font-family: var(--sans); color: var(--espresso-deep); transition: background .2s, padding .2s;
}
.tut-step:hover { background: rgba(184,147,109,.07); padding-left: 10px; }
.tut-step .tut-num {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold);
    display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-size: 16px;
}
.tut-step.done .tut-num { background: none; border-color: transparent; font-style: normal; font-size: 13px; }
.tut-step .tut-title { flex: 1; font-family: var(--serif); font-size: 20px; }
.tut-step.done .tut-title { color: var(--warm-brown); }
.tut-step .tut-mins { font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--warm-brown); white-space: nowrap; }
.tut-step .tut-play { width: 20px; height: 20px; color: var(--gold); }
.tut-modal-box { max-width: min(92vw, 900px) !important; width: 100%; }
.tut-modal-box video { width: 100%; background: #000; display: block; }

/* ---------- Membership details ---------- */
.info-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.info-row:last-of-type { border-bottom: none; }
.info-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--warm-brown); white-space: nowrap; }
.info-value { font-family: var(--serif); font-size: 19px; color: var(--espresso-deep); text-align: right; display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.info-value .field { min-width: 0; width: 170px; padding: 8px 10px; font-size: 13px; flex: none; }
.status-badge { font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-active { color: var(--success); }
.status-pending { color: var(--pending); }
.status-expired { color: var(--error); }
#manageSubRow .link-btn { width: 100%; margin-top: 22px; }
@media (max-width: 560px) { .info-value { font-size: 17px; } }

/* ---------- Referral: see three-doors.css ---------- */
.fine-print { margin-top: 18px; font-size: 11.5px; font-weight: 300; color: var(--warm-brown); line-height: 1.6; }

/* ---------- Quick links ---------- */
.links-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); margin-top: 18px; }
.links-grid a {
    display: flex; align-items: center; gap: 14px; padding: 22px 18px; text-decoration: none;
    border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--espresso-deep); transition: background .2s, color .2s;
}
.links-grid a:last-child { border-right: none; }
.links-grid a:hover { background: rgba(184,147,109,.08); color: var(--gold-dark); }
.links-grid a span { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.links-grid a .icon, .links-grid a .link-icon { width: 22px; height: 22px; color: var(--gold); }
.icon { filter: drop-shadow(0 1px .5px rgba(42,32,24,.2)); }
.links-grid a .arrow { margin-left: auto; color: var(--gold); transition: transform .2s; }
.links-grid a:hover .arrow { transform: translateX(4px); }
@media (max-width: 900px) { .links-grid { grid-template-columns: 1fr 1fr; } .links-grid a:nth-child(2n) { border-right: none; } }
@media (max-width: 480px) { .links-grid { grid-template-columns: 1fr; } .links-grid a { border-right: none; } }

/* ---------- Loading ---------- */
.loading { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 50vh; gap: 18px; color: var(--warm-brown); }
.spinner { width: 54px; height: 54px; animation: spin 2.4s linear infinite; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modals ---------- */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 10000; padding: 16px;
    background: rgba(42, 32, 24, 0.62); backdrop-filter: blur(4px); align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--paper); border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: 2px;
    padding: 36px 36px 32px; max-width: 520px; width: 100%; box-shadow: 0 30px 80px -30px rgba(42,32,24,.6);
    animation: modalIn .35s cubic-bezier(.2,.7,.3,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.modal-icon { display: none; }
.modal-title { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.15; color: var(--espresso-deep); }
.modal-text { color: var(--warm-brown); line-height: 1.7; margin-bottom: 16px; font-size: 14.5px; font-weight: 300; }
.countdown-display { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--espresso-deep); text-align: center; margin: 20px 0; }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }
.modal-close {
    background: none; border: none; cursor: pointer; font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--warm-brown); font-family: var(--sans);
}
.modal-close:hover { color: var(--espresso-deep); }

/* ---------- Footer ---------- */
.app-footer {
    max-width: 1180px; margin: 48px auto 0; padding: 24px 32px 40px; border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center;
    font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--warm-brown);
}
.app-footer a { color: var(--warm-brown); text-decoration: none; }
.app-footer a:hover { color: var(--gold); }
.app-footer .spacer { margin-left: auto; text-transform: none; letter-spacing: 0.04em; }
@media (max-width: 560px) { .app-footer { padding: 20px 16px 32px; } .app-footer .spacer { margin-left: 0; } }

/* No trial yet → the card form is the only thing on the page */
#dashboardContent.gated > :not(.welcome-section):not(#trialGate) { display: none !important; }
