/* ══════════════════════════════════════════════════════════════
   DYNASTY WEALTH SYSTEM — APP STYLES
   Brand tokens ported from resurrectiontemple.com for visual continuity.
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&family=Barlow:wght@300;400;500;600&family=Barlow+Condensed:wght@300;400;500;600;700&display=swap');

:root {
  --gold:        #C9A84C;
  --gold-light:  #E8C96A;
  --gold-dim:    #7A5F2A;
  --gold-pale:   rgba(201,168,76,0.08);
  --gold-border: rgba(201,168,76,0.22);
  --black:       #05101f;
  --surface:     #0a1a2e;
  --surface2:    #0d2040;
  --surface3:    #112640;
  --border:      rgba(255,255,255,0.07);
  --text:        #F0ECE4;
  --text2:       #9E9488;
  --text3:       #5C5650;
  --green:       #6FBF8B;
  --red:         #D97757;
  --font-display:'Cormorant Garamond', Georgia, serif;
  --font-body:   'Barlow', system-ui, sans-serif;
  --font-cond:   'Barlow Condensed', system-ui, sans-serif;
  --ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --radius:      6px;
  --radius-lg:   12px;
  --max-w:       1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 45% at 50% -5%, rgba(201,168,76,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 50% 25% at 90% 90%, rgba(201,168,76,0.04) 0%, transparent 55%);
}

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 1; }

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 64px;
  background: rgba(5,16,31,0.92);
  border-bottom: 1px solid var(--gold-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo { display: flex; flex-direction: column; gap: 2px; }
.logo-eyebrow {
  font-family: var(--font-cond);
  font-size: 8px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.75;
}
.logo-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--text);
}
.header-nav { display: flex; align-items: center; gap: 8px; }
.header-nav a, .header-nav button {
  padding: 7px 16px;
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text2);
  border: 1px solid transparent;
  border-radius: 20px;
  background: transparent;
  transition: all 0.2s var(--ease);
}
.header-nav a:hover, .header-nav button:hover { color: var(--gold-light); border-color: var(--gold-border); background: var(--gold-pale); }
.header-nav .btn-primary { padding: 8px 18px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 30px;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
}
.btn-primary { background: var(--gold); color: var(--black); }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--gold-border); color: var(--gold-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 10px; }

/* ── LAYOUT ── */
.page { min-height: calc(100vh - 64px); padding: 3rem 0 6rem; position: relative; z-index: 1; }
.page-narrow { max-width: 560px; margin: 0 auto; padding: 0 1.5rem; }
.eyebrow {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
h1.page-title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.75rem; }
.page-sub { color: var(--text2); font-size: 1.05rem; max-width: 640px; margin-bottom: 2.5rem; }

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}
.card + .card { margin-top: 1.25rem; }
.card-title { font-size: 1.35rem; margin-bottom: 0.5rem; }
.card-title .num { color: var(--gold); font-weight: 400; margin-right: 8px; }
.card-desc { color: var(--text2); font-size: 0.95rem; margin-bottom: 1.25rem; }

/* ── FORMS ── */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold-border);
  background: var(--surface3);
}
.field-hint { color: var(--text3); font-size: 0.8rem; margin-top: 5px; }
.field-error { color: var(--red); font-size: 0.85rem; margin-top: 6px; }
.form-msg { padding: 10px 14px; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 1rem; }
.form-msg.error { background: rgba(217,119,87,0.12); border: 1px solid rgba(217,119,87,0.35); color: #F0B7A0; }
.form-msg.success { background: rgba(111,191,139,0.12); border: 1px solid rgba(111,191,139,0.35); color: #B7E3C6; }

.inline-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }

/* ── DATA TABLES (worksheets) ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table th { font-family: var(--font-cond); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text2); font-weight: 500; }
.data-table td input, .data-table td select {
  width: 100%; padding: 7px 10px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-size: 0.9rem;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table .row-total td { font-weight: 600; color: var(--gold-light); border-top: 1px solid var(--gold-border); }
.table-scroll { overflow-x: auto; }

/* ── REFERENCE TABLE (static content, read-only) ── */
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ref-table th, .ref-table td { padding: 10px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.ref-table th { background: var(--surface2); font-family: var(--font-cond); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); font-weight: 500; }
.ref-table tr:nth-child(even) td { background: rgba(255,255,255,0.015); }

/* ── CHECKLIST ── */
.checklist { list-style: none; }
.checklist li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.checklist li:last-child { border-bottom: none; }
.checklist input[type="checkbox"] {
  width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gold); flex-shrink: 0; cursor: pointer;
}
.checklist .item-title { font-weight: 500; }
.checklist .item-detail { color: var(--text2); font-size: 0.87rem; margin-top: 3px; }

/* ── STATUS PILL ── */
.status-select { padding: 6px 10px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 0.82rem; }

/* ── CALCULATOR RESULT ── */
.calc-result {
  margin-top: 1rem; padding: 1.25rem 1.5rem;
  background: var(--gold-pale); border: 1px solid var(--gold-border); border-radius: var(--radius);
  display: flex; flex-wrap: wrap; gap: 2rem;
}
.calc-result .stat-label { font-family: var(--font-cond); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text2); margin-bottom: 4px; }
.calc-result .stat-value { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold-light); }

/* ── PROGRESS ── */
.progress-bar { height: 8px; background: var(--surface2); border-radius: 20px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 20px; transition: width 0.4s var(--ease); }

/* ── DASHBOARD GRID ── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }

.module-tile {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.5rem; transition: all 0.2s var(--ease); position: relative;
}
.module-tile:hover { border-color: var(--gold-border); transform: translateY(-2px); }
.module-tile .mod-num { font-family: var(--font-cond); font-size: 11px; letter-spacing: 0.2em; color: var(--gold); text-transform: uppercase; }
.module-tile h3 { font-size: 1.3rem; margin: 6px 0 8px; }
.module-tile p { color: var(--text2); font-size: 0.88rem; }
.module-tile .lock-badge {
  position: absolute; top: 1.25rem; right: 1.25rem; font-family: var(--font-cond); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text2); border: 1px solid var(--border);
  padding: 4px 9px; border-radius: 20px;
}
.module-tile.locked { opacity: 0.72; }
.module-tile .free-badge {
  position: absolute; top: 1.25rem; right: 1.25rem; font-family: var(--font-cond); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold-border);
  background: var(--gold-pale); padding: 4px 9px; border-radius: 20px;
}

/* ── PAYWALL PANEL ── */
.paywall {
  text-align: center; padding: 4rem 2rem; background: var(--surface); border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg); max-width: 560px; margin: 3rem auto;
}
.paywall h2 { font-size: 1.8rem; margin-bottom: 0.75rem; }
.paywall p { color: var(--text2); margin-bottom: 1.75rem; }

/* ── NOTES / TAKEAWAYS ── */
.notes-block { margin-top: 2rem; }
.takeaway-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.takeaway-row .num { font-family: var(--font-display); color: var(--gold); font-size: 1.2rem; width: 20px; }
.takeaway-row input { flex: 1; }

/* ── MODULE NAV (prev/next) ── */
.module-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* ── AUTOSAVE INDICATOR ── */
.save-indicator { font-family: var(--font-cond); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3); display: flex; align-items: center; gap: 6px; }
.save-indicator.saving { color: var(--gold); }
.save-indicator.saved { color: var(--green); }
.save-indicator .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── MISC ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.subtle-link { color: var(--text2); font-size: 0.88rem; }
.subtle-link:hover { color: var(--gold-light); }
.text-center { text-align: center; }
.disclaimer { color: var(--text3); font-size: 0.78rem; text-align: center; padding: 2rem 0 0; }
.pull-quote { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--gold-light); border-left: 2px solid var(--gold); padding-left: 1.25rem; margin: 1.5rem 0; }

@media (max-width: 720px) {
  .header-nav a span, .header-nav button span { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
