/* ============================================================
   TALLOWWOOD WEALTH ADVICE — Shared UI styles for Fact-Find + Team Portal
   Palette and type per the Tallowwood Wealth Advice Brand Guide v2.0
   ============================================================ */

/* Cormorant Garamond = H1/H2 display only. Open Sans = every heading below
   that, all form labels, inputs, tables and buttons. The portal is dense,
   form-heavy and read by a 50+ audience, so running UI stays on the sans. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Open+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- Brand palette (guide v2.0) ---- */
  --olive:        #808F72;  /* Olive Sage    — primary brand colour        */
  --olive-mid:    #6C7A60;  /* hover / intermediate chrome                 */
  --olive-deep:   #3F4A36;  /* dark chrome that carries white/cream text   */
  --olive-soft:   rgba(128,143,114,.12);
  --amber:        #C89520;  /* Amber Gold    — accent / CTA                */
  --amber-hover:  #B08217;
  --amber-ink:    #8A6511;  /* small amber text: 4.8:1 on cream, 5.4:1 on white */
  --amber-light:  #EABE55;  /* accent text on dark chrome (AA at 5.3:1)    */
  --amber-soft:   rgba(200,149,32,.14);
  --navy:         #1B3058;  /* Dark Navy     — headings, links             */
  --navy-2:       #2F4C82;
  --burgundy:     #5E2B38;  /* Brand Burgundy — LOGO WORDMARK ONLY         */
  --cream:        #EDE8D5;  /* Cream Ivory   — panels, alternating rows    */
  --charcoal:     #2C2C2C;  /* Charcoal      — all running body text       */
  --brick:        #A6412F;  /* errors / required — not in the guide,
                               added because the guide defines no error
                               colour and burgundy is reserved for the logo */

  /* ---- Contrast notes (WCAG 2.1 AA, verified) ----
     Olive Sage #808F72 on white is only 3.45:1, so it is never used behind
     small text. Text-bearing chrome uses --olive-deep (#3F4A36) at 9.3:1
     against white. Amber Gold is 5.0:1 against charcoal but only 2.7:1
     against white, so amber buttons always take charcoal ink.            */

  /* ---- Legacy token names, remapped ----
     These names date from the original palette and are kept so the existing
     var() call sites across the fact-find, portal and print stylesheets keep
     working. Each now resolves to its Tallowwood equivalent.             */
  --blue:         var(--navy);        /* interactive text / links */
  --blue-hover:   var(--navy-2);
  --green:        var(--olive);       /* growth / success fills   */
  --green-hover:  var(--olive-mid);
  --magenta:      var(--brick);       /* errors, required marker  */
  --lilac:        #C9C3D6;
  --lime:         var(--amber);       /* highlight                */

  /* neutrals — warmed so they sit with cream rather than reading cool */
  --white: #FFFFFF;
  --off-white: #FAF8F2;
  --paper: var(--cream);
  --line: #DDD8C6;
  --line-strong: #C3BCA4;
  --mute: #6E6A5F;
  --mute-2: #948F80;
  --ink: var(--charcoal);
  --ink-soft: #4A4A46;

  /* semantic (overridable for Tweaks) */
  --accent: var(--amber);
  --accent-ink: var(--charcoal);      /* amber needs dark ink, not white */
  --accent-soft: var(--amber-soft);

  /* surfaces */
  --bg-app: #F5F2E9;
  --bg-card: var(--white);
  --bg-inset: var(--off-white);

  /* radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* shadows — warm-tinted to match the cream canvas */
  --shadow-1: 0 1px 2px rgba(63,74,54,.07), 0 1px 1px rgba(63,74,54,.05);
  --shadow-2: 0 8px 24px rgba(63,74,54,.09), 0 2px 6px rgba(63,74,54,.06);
  --shadow-3: 0 24px 60px rgba(63,74,54,.18), 0 6px 14px rgba(63,74,54,.09);
  --shadow-focus: 0 0 0 3px rgba(200,149,32,.28);

  /* type */
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* motion */
  --t-fast: 120ms;
  --t-med:  220ms;
  --ease:   cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;          /* raised from 15px for the 50+ audience */
  line-height: 1.6;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--amber-hover); }

/* -------- Headings --------
   H1/H2 are the guide's Cormorant Garamond display tiers; H3 and below drop
   to Open Sans so dense form UI stays legible. Page stylesheets override the
   size and weight but inherit the family from here. */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
  color: var(--navy);
}
h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--navy);
}

/* -------- Type helpers -------- */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  /* Amber Gold and even --amber-hover fall below AA at this size on white
     (2.7:1 and 3.5:1), so eyebrows take the deeper ochre at 4.6:1. */
  text-transform: uppercase; color: var(--amber-ink);
}
.eyebrow-dim { color: var(--mute); }
.display {
  font-family: var(--font-display);
  font-weight: 700; letter-spacing: 0; line-height: 1.05;
  color: var(--navy);
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px;
  padding: 12px 20px; border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--amber-hover); outline-offset: 2px; }

/* Primary action = Amber Gold with charcoal ink (5.0:1). */
.btn-primary { background: var(--amber); color: var(--charcoal); }
.btn-primary:hover { background: var(--amber-hover); color: var(--white); }

.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--amber-hover); color: var(--white); }

/* Secondary / confirm = deep olive with white ink (9.3:1). */
.btn-green { background: var(--olive-deep); color: var(--white); }
.btn-green:hover { background: var(--olive-mid); }

.btn-lime { background: var(--amber); color: var(--charcoal); }
.btn-lime:hover { background: var(--amber-hover); color: var(--white); }

.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--olive); background: var(--olive-soft); }

.btn-ghost-dark { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,.28); }
.btn-ghost-dark:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.5); }

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-xs { padding: 6px 10px; font-size: 12px; border-radius: var(--r-sm); }

/* -------- Form controls -------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft);
}
.field-label .req { color: var(--brick); margin-left: 2px; }
.field-hint { font-size: 13px; color: var(--mute); line-height: 1.45; }

.input, .select, .textarea {
  font-size: 15px; font-weight: 400;
  color: var(--charcoal); background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 11px 13px; outline: none; width: 100%;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--amber); box-shadow: var(--shadow-focus);
}
.input::placeholder, .textarea::placeholder { color: var(--mute-2); font-weight: 400; }
.textarea { min-height: 88px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%232C2C2C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}

/* chip-style radio / checkbox */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: var(--r-md);
  background: var(--white); border: 1.5px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--charcoal);
  cursor: pointer; user-select: none;
  transition: all var(--t-fast) var(--ease);
  line-height: 1.3;
}
.chip:hover { border-color: var(--line-strong); background: var(--off-white); }
.chip.on {
  border-color: var(--olive); background: var(--olive-soft);
  color: var(--olive-deep); box-shadow: inset 0 0 0 1px var(--olive);
}
.chip.on::before { content: '✓'; font-weight: 700; font-size: 12px; }
.chip input { display: none; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* -------- Status pills -------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  /* Keep the pill on a single line - "In progress" was wrapping in
     narrower table cells and pushing the row to two lines. */
  white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-invited { color: #7A5B00; background: var(--amber-soft); }
.status-started { color: var(--navy); background: rgba(27,48,88,.10); }
.status-progress { color: var(--navy); background: rgba(27,48,88,.10); }
.status-submitted { color: var(--olive-deep); background: var(--olive-soft); }
.status-reviewed { color: var(--white); background: var(--olive-deep); }
.status-stale { color: var(--brick); background: rgba(166,65,47,.12); }

/* -------- Cards -------- */
.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 28px;
}
.card-inset { background: var(--off-white); border-radius: var(--r-md); padding: 18px; }

/* accent rule under nav */
.accent-strip { display: flex; height: 3px; background: var(--olive); }
.accent-strip > div { flex: 1; }

/* -------- Utility -------- */
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; }
.divider { height: 1px; background: var(--line); border: 0; margin: 20px 0; }
.divider-dashed { border: 0; border-top: 1.5px dashed var(--line); margin: 20px 0; }

.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; letter-spacing: 0.02em; }

/* small scrollbar polish */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); border: 2px solid var(--bg-app); }
::-webkit-scrollbar-thumb:hover { background: var(--mute-2); }
