/*
 * theme.css — Apanaghar Smart Plan design tokens.
 *
 * Blueprint precision (swiss) warmed by paper and terracotta (warm-craft):
 * a technical service that still feels like a studio. --accent is the
 * terracotta filled action; --accent-text is the blueprint-navy link colour.
 */

:root {
  --canvas: #f6f2ea;
  --surface: #fbf9f6;
  --surface-2: #ede4d5;
  --border: #e2d9c8;
  --border-strong: #c9bda3;
  --ink: #23303b;
  --muted: #5c6264;

  --accent: #a8541f;
  --accent-hover: #8a4419;
  --accent-ink: #ffffff;
  --accent-text: #2b4c7e;
  --accent-strong: #974f25;
  --accent-soft: #f3e3d8;
  --accent-border: #dba983;

  --success: #1f7a4d;
  --success-ink: #ffffff;
  --success-soft: #dcefe2;
  --success-strong: #146238;
  --warning: #a8631b;
  --warning-ink: #ffffff;
  --warning-soft: #f3e6d3;
  --warning-strong: #8a4f14;
  --danger: #b3261e;
  --danger-ink: #ffffff;
  --danger-soft: #f6dedb;
  --danger-strong: #8f1e17;

  --chart-1: #2b4c7e;
  --chart-2: #c1652f;
  --chart-3: #5c8a72;
  --chart-4: #9c6b9e;
  --chart-5: #c9a227;
  --chart-6: #5b7a99;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: -0.01em;
  --eyebrow-tracking: 0.06em;

  --radius-btn: 10px;
  --radius-card: 16px;
  --radius-input: 10px;
  --border-w: 1px;
  --border-strong-w: 1px;
  --shadow-card: 0 1px 2px rgba(35, 48, 59, 0.04), 0 8px 20px -6px rgba(35, 48, 59, 0.08);
  --shadow-raised: 0 20px 45px -14px rgba(35, 48, 59, 0.28);
  --shadow-btn: none;
  --card-pad: 1.5rem;
  --caps: none;
  --caps-tracking: 0.02em;
  --btn-weight: 600;
  --measure: 68ch;

  /* Built from --ink and --accent-text, not fixed hex, so it inverts
     brightness together with the --canvas text it is always paired with —
     dark navy in light mode, and (since --ink turns light) a light band in
     dark mode. Never re-declared in the dark block: it reads those two
     tokens, which already differ there. */
  --gradient-blueprint: linear-gradient(
    135deg,
    var(--ink) 0%,
    color-mix(in srgb, var(--ink) 88%, var(--accent-text) 12%) 55%,
    color-mix(in srgb, var(--ink) 78%, var(--accent-text) 22%) 100%
  );
}

html[data-theme="dark"] {
  --canvas: #171d24;
  --surface: #1f2830;
  --surface-2: #26313b;
  --border: #33404b;
  --border-strong: #4a5964;
  --ink: #ece7dd;
  --muted: #a3a9ab;

  --accent: #d97a43;
  --accent-hover: #e78a54;
  --accent-ink: #201007;
  --accent-text: #8fb0dd;
  --accent-strong: #e2965f;
  --accent-soft: #3a2418;
  --accent-border: #5a3b26;

  --success: #2a8f5c;
  --success-ink: #ffffff;
  --success-soft: #16332a;
  --success-strong: #5cc793;
  --warning: #c07f2c;
  --warning-ink: #201007;
  --warning-soft: #3a2a14;
  --warning-strong: #e0a94f;
  --danger: #c8483f;
  --danger-ink: #ffffff;
  --danger-soft: #3a1917;
  --danger-strong: #e2837b;

  --chart-1: #8fb0dd;
  --chart-2: #e2965f;
  --chart-3: #7fb495;
  --chart-4: #c69bc8;
  --chart-5: #d9bd5a;
  --chart-6: #8aa8c2;
}

/*
 * app.css — Apanaghar Smart Plan's own surfaces: the blueprint-grid ground,
 * the static top bar, the hero/trust bands, the stat cards that count up,
 * and the plan-status timeline. Everything below reads theme.css tokens.
 */

/* ---- Ground -------------------------------------------------------------- */
body {
  background-color: var(--canvas);
}

/* A faint architectural grid — the one texture this app owns. */
.blueprint-grid {
  background-color: var(--canvas);
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent-text) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent-text) 7%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ---- Top bar --------------------------------------------------------------
   Static on purpose: it scrolls away with the page, no blur, no shadow. */
.site-header {
  background-color: var(--canvas);
  border-bottom: var(--border-w, 1px) solid var(--border);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-btn, 10px);
  background: var(--gradient-blueprint);
  color: var(--canvas);
}
.brand-mark .icon { width: 1rem; height: 1rem; }

.app-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-btn, 10px);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color 150ms, color 150ms;
}
.app-nav-link:hover { color: var(--ink); background-color: var(--surface-2); text-decoration: none; }
.app-nav-link.is-active { color: var(--accent-text); background-color: var(--accent-soft); font-weight: 600; }

/* ---- Hero / statement bands ------------------------------------------------
   No new tokens: the band is the page's own --ink used as a ground with
   --canvas as its ink, the exact pair theme.css already contrast-checks —
   so it is provably readable in both modes, light-on-dark in light mode and
   (inverted, since --ink and --canvas swap brightness) dark-on-light in
   dark mode. currentColor picks up whichever of those is active. */
.band-hero {
  position: relative;
  background: var(--gradient-blueprint);
  color: var(--canvas);
  overflow: hidden;
}
.band-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, currentColor 12%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, currentColor 12%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, color-mix(in srgb, currentColor 90%, transparent), color-mix(in srgb, currentColor 15%, transparent));
}

.band-dark {
  background-color: var(--ink);
  color: var(--canvas);
}

.band-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--eyebrow-tracking, 0.06em);
  text-transform: uppercase;
  color: color-mix(in srgb, currentColor 75%, transparent);
}

.band-sub { color: color-mix(in srgb, currentColor 80%, transparent); }
.band-sub-soft { color: color-mix(in srgb, currentColor 65%, transparent); }

.band-link { color: currentColor; text-decoration-color: color-mix(in srgb, currentColor 60%, transparent); }

.band-btn-outline {
  border-color: color-mix(in srgb, currentColor 32%, transparent);
  background: transparent;
  color: currentColor;
}
.band-btn-outline:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
  border-color: color-mix(in srgb, currentColor 55%, transparent);
}

.band-icon-chip {
  background: color-mix(in srgb, currentColor 16%, transparent);
  color: currentColor;
}

.band-title { color: currentColor; }

.band-media {
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 14%, transparent), var(--shadow-raised);
}

/* ---- Stat cards (count-up is the app's one motion) ------------------------- */
.stat-card {
  border: var(--border-w, 1px) solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-card, 16px);
  padding: 1.25rem 1.375rem;
  box-shadow: var(--shadow-card);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ---- Numbered step cards (how it works) ------------------------------------ */
.step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-text);
  border: var(--border-w, 1px) solid var(--accent-border);
  background: var(--accent-soft);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
}

/* ---- Plan status timeline --------------------------------------------------- */
.status-track { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.status-step {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: var(--border-w, 1px) solid var(--border);
  color: var(--muted);
  background: var(--surface-2);
}
.status-step.is-done { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent-border); }
.status-step.is-current { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* ---- Plan code, mono where a figure or an id wants precision ---------------- */
.plan-code { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* ---- New Plan wizard --------------------------------------------------------
   The step list. A straight line of numbered stops — swiss, not a fancy
   progress bar — that scrolls on a narrow phone rather than wrapping. */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: max-content;
}
.wizard-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  border-radius: 999px;
  border: var(--border-w, 1px) solid var(--border);
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
  transition: border-color 150ms, background-color 150ms, color 150ms;
}
.wizard-step:hover { color: var(--ink); border-color: var(--border-strong); text-decoration: none; }
.wizard-step + .wizard-step::before {
  content: "";
  display: inline-block;
  width: 1.25rem;
  height: var(--border-w, 1px);
  background: var(--border-strong);
  margin-right: 0.5rem;
}
.wizard-step-dot {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  flex-shrink: 0;
}
.wizard-step.is-done .wizard-step-dot { background: var(--accent-soft); color: var(--accent-strong); }
.wizard-step.is-current { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.wizard-step.is-current .wizard-step-dot { background: var(--accent); color: var(--accent-ink); }

/* Plot Details: pure-CSS progressive disclosure between the two measurement
   methods — no script, correct with no JavaScript at all. */
.plot-form:has(#mm_irregular:checked) .fields-rect { display: none; }
.plot-form:has(#mm_rect:checked) .fields-irregular { display: none; }

/* Package Selection: a selectable card built from a radio input the browser
   never draws — the whole card is the hit target, the accent ring says which
   one is picked. */
.package-card {
  position: relative;
  display: block;
  cursor: pointer;
  padding: 1.25rem;
  border: var(--border-w, 1px) solid var(--border-strong);
  border-radius: var(--radius-card, 16px);
  background: var(--surface);
  transition: border-color 150ms, box-shadow 150ms;
}
.package-card:hover { border-color: var(--ink); }
.package-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.package-card-check {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 999px;
  border: var(--border-w, 1px) solid var(--border-strong);
  color: transparent;
  background: var(--surface);
}
.package-card.is-selected .package-card-check { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
