/*
 * rhz-app.css
 * ===========
 * RHZ Design System → App bridge.
 *
 * Imports the canonical design system tokens, then re-exports them as the
 * legacy variable names used across wizard.html, dashboard.html and auth
 * pages. All existing CSS classes continue to work unchanged — they just get
 * the new brand colours, fonts and motion automatically.
 *
 * DO NOT change this file to affect printed booklets.
 * Booklet tokens live in templates/master/tokens.css — completely separate.
 */

/* ── 1. Design system foundation ────────────────────────────────────── */
@import url("/static/design-system/tokens/fonts.css");
@import url("/static/design-system/tokens/colors.css");
@import url("/static/design-system/tokens/typography.css");
@import url("/static/design-system/tokens/spacing.css");
@import url("/static/design-system/tokens/elevation.css");
@import url("/static/design-system/tokens/motion.css");

/* ── 2. Legacy variable aliases ──────────────────────────────────────
   Every template that used --teal, --dark-ink, --cream etc now resolves
   to the correct brand token. Nothing else in the templates needs to
   change. */
:root {
  /* Primary brand: teal → RHZ purple */
  --teal:        var(--brand);          /* #7B5AA6 */
  --bright-teal: var(--purple-400);     /* #9778BE  */

  /* Accent: gold → RHZ lime (use dark ink on lime, not white) */
  --amber: var(--accent);               /* #AFCF5A */
  --gold:  var(--accent);

  /* Backgrounds */
  --cream:    var(--color-bg);          /* #FAF7F1 */
  --white:    var(--cream-card);        /* #FFFFFF */

  /* Ink */
  --dark-ink: var(--ink-900);           /* #28262F */

  /* Borders / rules */
  --rule-clr:  var(--border);           /* #ECE6DA */
  --rule-strong: var(--border-strong);  /* #E0D8C8 */

  /* Status */
  --red:     var(--danger);             /* #D2544B */
  --green:   var(--success);            /* #4F9D5B */

  /* ── Fonts ─────────────────────────────────────────────────────── */
  /* Display / headings: Poppins replaces Fraunces + Bricolage */
  --display: var(--font-display);       /* "Poppins", ... */
  --logo:    var(--font-display);       /* "Poppins", ... */

  /* Body copy: Nunito Sans replaces Source Serif 4 */
  --body:    var(--font-body);          /* "Nunito Sans", ... */

  /* Hand / sketch accent */
  --hand:    var(--font-hand);          /* "Caveat", ... */

  /* ── Radii ──────────────────────────────────────────────────────── */
  --radius-card:   var(--radius-lg);    /* 20px */
  --radius-btn:    var(--radius-pill);  /* fully rounded */
  --radius-input:  var(--radius-md);    /* 14px */
  --radius-badge:  var(--radius-pill);

  /* ── Shadows ────────────────────────────────────────────────────── */
  --shadow-card:  var(--shadow-md);
  --shadow-hover: var(--shadow-lg);
  --shadow-btn:   var(--shadow-brand);

  /* ── Motion ─────────────────────────────────────────────────────── */
  --ease:        var(--ease-out);       /* cubic-bezier(.22,.61,.36,1) */
  --transition:  200ms var(--ease);
}

/* ── 3. Global base overrides ────────────────────────────────────────
   Upgrade the handful of elements that need the new brand without
   touching existing component CSS. */

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

/* Headings pick up Poppins automatically */
h1, h2, h3, h4, h5, h6,
.step-title, .section-title, .card-title,
.topbar__brand, .logo {
  font-family: var(--font-display);
}

/* ── Primary action buttons ─────────────────────────────────────── */
.btn--primary,
.btn-primary,
button[type="submit"].primary,
.cta-btn {
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-brand);
  transition: background var(--transition), transform var(--transition),
              box-shadow var(--transition);
}
.btn--primary:hover,
.btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn--primary:active,
.btn-primary:active {
  transform: scale(0.97);
  background: var(--brand-press);
}

/* ── Ghost / outline buttons ────────────────────────────────────── */
.btn--ghost,
.btn-ghost {
  border: var(--border-w) solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-heading);
  transition: border-color var(--transition), color var(--transition);
}
.btn--ghost:hover,
.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card,
.card-btn,
.plan-card,
.result-file,
.feedback-card,
.pdf-viewer {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover,
.card-btn:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-btn.selected {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, transparent);
}

/* ── Step indicators ─────────────────────────────────────────────── */
.step-dot.active,
.step-dot.done {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}
.step-line.done {
  background: var(--brand);
}

/* ── Topbar ──────────────────────────────────────────────────────── */
.topbar {
  background: var(--ink-900);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* ── Focus ring ──────────────────────────────────────────────────── */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ── Reveal animation (matches design system rhz-reveal) ────────── */
@media (prefers-reduced-motion: no-preference) {
  .rhz-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out);
  }
  .rhz-reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}


/* ── Notes-grade shared components ───────────────────────────────────
   Reusable surface/pill/chip styling extracted from the notes editor so
   every page shares the same warm, soft-shadow look. Token-based — opt-in
   classes, additive (no existing layout is overridden). */
.soft-card {
  background: var(--cream-card, #fff);
  border: 1px solid var(--border, #ECE6DA);
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.soft-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.soft-bar {
  background: rgba(255, 253, 248, .93);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border, #ECE6DA);
}

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font: 700 12px var(--font-body, sans-serif);
  color: var(--brand, #7B5AA6);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  padding: 4px 12px; border-radius: 999px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong, #E0D8C8);
  background: var(--cream-card, #fff);
  border-radius: 999px; padding: 5px 12px;
  font: 600 12.5px var(--font-body, sans-serif);
  color: var(--ink-700, #42404B); cursor: pointer;
  transition: all var(--transition);
}
.chip:hover {
  border-color: var(--brand, #7B5AA6); color: var(--brand, #7B5AA6);
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.chip.on {
  border-color: var(--brand); color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }

.soft-input, .soft-select {
  font: 600 13px var(--font-body, sans-serif); color: var(--ink-900, #28262F);
  border: 1px solid var(--border-strong, #E0D8C8);
  border-radius: var(--radius-md, 12px);
  padding: 7px 11px; background: var(--cream-card, #fff);
  outline: none; transition: border-color var(--transition);
}
.soft-input:focus, .soft-select:focus { border-color: var(--brand, #7B5AA6); }
