/* @aiherway/shared/tokens.css
 * The canonical AI Her Way design system. Editorial sharp aesthetic.
 * Apply by including <link rel="stylesheet" href="./shared/tokens.css">.
 * Derived from the static apps in this monorepo; matches the brand guide.
 */

:root {
  /* Core brand */
  --charcoal: #252620;
  --linen: #F1EAE1;
  --light-cream: #F8F6F3;
  --forest-green: #22392C;
  --misty-sage: #C0CACE;
  --earth-clay: #876553;

  /* Aliases */
  --bg: var(--linen);
  --surface: var(--light-cream);
  --text: var(--charcoal);
  --text-muted: #5A5A52;
  --border: var(--forest-green);
  --accent: var(--earth-clay);

  /* States */
  --error: #B85450;
  --success: #5A7058;

  /* Fonts */
  --font-heading: 'Noto Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Type scale */
  --fs-eyebrow: 0.72rem;
  --fs-body: 1rem;
  --fs-h3: 1.5rem;
  --fs-h2: 2rem;
  --fs-h1: 2.75rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Structure */
  --border-w: 2px;
  --radius: 0;
  --max-content: 880px;
}

/* Base */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--space-4); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--forest-green); }

.eyebrow {
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 var(--space-3);
}

.container {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  background: var(--misty-sage);
  color: var(--forest-green);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1.2;
}
.btn:hover { background: var(--forest-green); color: var(--linen); }
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--text-muted);
}
.btn-secondary:hover { background: var(--light-cream); color: var(--text); border-color: var(--text); }

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
textarea,
select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  line-height: 1.4;
}
input:focus, textarea:focus, select:focus {
  outline: 3px solid var(--accent);
  outline-offset: 0;
}
textarea { resize: vertical; min-height: 6rem; }
::placeholder { color: var(--text-muted); opacity: 0.7; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* Cards */
.card {
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  padding: var(--space-6);
}

/* Hero header (negative-margin breakout) */
.hero {
  background: var(--charcoal);
  color: var(--linen);
  padding: var(--space-12) var(--space-6);
  margin: 0 calc(var(--space-6) * -1) var(--space-12);
  border-bottom: var(--border-w) solid var(--forest-green);
}
.hero h1, .hero h2 { color: var(--linen); }
.hero .eyebrow { color: var(--misty-sage); }

/* Progress bar (fixed top, 4px, clay fill) */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--linen);
  z-index: 50;
}
.progress-bar__fill {
  height: 100%;
  background: var(--earth-clay);
  width: 0%;
  transition: width 0.3s ease;
}

/* Step indicator */
.step-indicator {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--linen);
  padding: var(--space-2) var(--space-3);
  border: var(--border-w) solid var(--border);
  font-weight: 600;
  z-index: 40;
}

/* Multi-select pill input */
.pill-input {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.pill {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border: var(--border-w) solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.pill[aria-pressed="true"],
.pill:hover { background: var(--misty-sage); }

/* Validation + errors */
.field {
  margin-bottom: var(--space-6);
}
.field-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: var(--space-2);
}
.field.has-error input,
.field.has-error textarea,
.field.has-error select {
  border-color: var(--error);
}

/* Toast */
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  background: var(--charcoal);
  color: var(--linen);
  padding: var(--space-3) var(--space-6);
  border: var(--border-w) solid var(--forest-green);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.toast--visible { opacity: 1; }

/* Sidebar (sticky, holds the edit links for the review pattern) */
.sidebar {
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  padding: var(--space-4);
  position: sticky;
  top: var(--space-6);
}
.sidebar h3 {
  font-size: 1rem;
  margin: 0 0 var(--space-3);
}
.sidebar ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.sidebar a {
  color: var(--text);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--misty-sage);
}
.sidebar a:hover { color: var(--accent); }
.sidebar a .edit { font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); }

/* Two-column review layout */
.review-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 720px) {
  .review-grid { grid-template-columns: 1fr; }
}

/* sr-only */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Hidden utility */
.hidden { display: none !important; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
