/* Design Tokens — Romantic Cozy Christmas Stationery */
:root {
  /* Core Palette */
  --bg-canvas: #fbf6ee;
  --bg-canvas-deep: #f3e9da;
  --bg-surface: #fffdf9;
  --bg-surface-warm: #f9f1e4;
  --bg-wine: #6b1d2b;
  --bg-wine-hover: #7f2435;
  --bg-wine-dark: #4a111c;
  --bg-pine: #234233;
  --bg-pine-soft: #eef4f0;

  /* Accent & Metallic */
  --accent-gold: #b88936;
  --accent-gold-bright: #d4a84f;
  --accent-gold-soft: #f2e4c4;
  --accent-rose: #b85c68;
  --accent-rose-soft: #faecef;

  /* Text Tokens (WCAG AA+ contrast) */
  --text-primary: #2b1b1e;
  --text-secondary: #624a4f;
  --text-muted: #7a6368;
  --text-on-wine: #fbf6ee;
  --text-on-pine: #f7f4ee;
  --text-on-gold: #2b1b1e;

  /* Borders & Dividers */
  --border-subtle: rgba(107, 29, 43, 0.14);
  --border-medium: rgba(107, 29, 43, 0.24);
  --border-gold: rgba(184, 137, 54, 0.45);

  /* Semantic Status */
  --status-success: #245c40;
  --status-success-bg: #eaf5ef;
  --status-error: #9e1f2e;
  --status-error-bg: #fdecef;
  --status-warning: #8a5a12;
  --status-warning-bg: #fdf5e3;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(43, 27, 30, 0.06);
  --shadow-md: 0 8px 24px rgba(43, 27, 30, 0.1);
  --shadow-lg: 0 20px 50px rgba(43, 27, 30, 0.18);
  --shadow-seal: 0 4px 10px rgba(74, 17, 28, 0.28);

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-hand: 'Caveat', 'Segoe Script', cursive;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing Scale (0.25rem increments) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radii */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-pill: 9999px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 160ms var(--ease-out);
  --transition-base: 260ms var(--ease-out);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

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

.hidden {
  display: none !important;
}

/* Shared Toast Notification */
.toast-container {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  background: var(--bg-wine-dark);
  color: var(--text-on-wine);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-pill);
  padding: var(--space-3) var(--space-5);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-base), transform var(--transition-base);
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--success {
  background: var(--bg-pine);
}

.toast--error {
  background: var(--status-error);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
