/* ═══════════════════════════════════════════════════════════════════════════
   STELLARE DESIGN SYSTEM
   Luxury dark theme · Gold accent · Cinematic feel
   ═══════════════════════════════════════════════════════════════════════════

   Brand direction: Cartier, Bulgari, Audemars Piguet aesthetic.
   Dark UI, cinematic feel, gold/warm accent tones.
   Strong typography hierarchy. Clean, motion-ready.

   Import this file before any page-specific CSS.
   All tokens are CSS custom properties on :root.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ── FONTS ──────────────────────────────────────────────────────────────── */
/* Syne: bold display typeface for headings, numbers, brand elements        */
/* DM Sans: refined sans-serif for body text, UI elements, readable copy    */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&display=swap');


/* ── COLOR TOKENS ───────────────────────────────────────────────────────── */

:root {
  /* Backgrounds — layered depth system
     Use bg-deep for page, bg-primary for sections, bg-card for contained
     elements, bg-elevated for overlays/modals, bg-surface for inputs       */
  --color-bg-deep:       #08080a;
  --color-bg-primary:    #0c0c0e;
  --color-bg-card:       #111114;
  --color-bg-elevated:   #18181c;
  --color-bg-surface:    #1e1e23;
  --color-bg-hover:      #232329;

  /* Gold accent palette — primary brand color
     gold is the default, gold-light for hover/emphasis,
     gold-dim for subtle/secondary, gold-muted for disabled              */
  --color-gold:          #c9a84c;
  --color-gold-light:    #e4cc7a;
  --color-gold-bright:   #f0dfa0;
  --color-gold-dim:      #8a7233;
  --color-gold-muted:    #6b5a2e;
  --color-gold-subtle:   #4a3f24;

  /* Gold with alpha — for glows, overlays, borders                       */
  --color-gold-a5:       rgba(201, 168, 76, 0.05);
  --color-gold-a8:       rgba(201, 168, 76, 0.08);
  --color-gold-a12:      rgba(201, 168, 76, 0.12);
  --color-gold-a15:      rgba(201, 168, 76, 0.15);
  --color-gold-a20:      rgba(201, 168, 76, 0.20);
  --color-gold-a30:      rgba(201, 168, 76, 0.30);

  /* Text hierarchy — 4 levels, all warm-tinted for luxury feel           */
  --color-text-primary:  #f0ece2;
  --color-text-secondary:#9a958a;
  --color-text-muted:    #5e5a52;
  --color-text-disabled: #3d3a35;

  /* Borders                                                               */
  --color-border:        #1f1f24;
  --color-border-light:  #2a2a30;
  --color-border-strong: #35353c;
  --color-border-gold:   rgba(201, 168, 76, 0.20);

  /* Status colors — muted to fit dark luxury palette                     */
  --color-success:       #4ade80;
  --color-success-dim:   #166534;
  --color-success-bg:    rgba(74, 222, 128, 0.08);
  --color-error:         #f87171;
  --color-error-dim:     #991b1b;
  --color-error-bg:      rgba(248, 113, 113, 0.08);
  --color-warning:       #fbbf24;
  --color-warning-dim:   #92400e;
  --color-warning-bg:    rgba(251, 191, 36, 0.08);
  --color-info:          #60a5fa;
  --color-info-dim:      #1e40af;
  --color-info-bg:       rgba(96, 165, 250, 0.08);


  /* ── TYPOGRAPHY TOKENS ──────────────────────────────────────────────── */

  /* Font families                                                         */
  --font-display:        'Syne', sans-serif;
  --font-body:           'DM Sans', sans-serif;
  --font-mono:           'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Type scale — rem-based, 16px root                                    */
  --text-xs:             0.75rem;     /* 12px */
  --text-sm:             0.875rem;    /* 14px */
  --text-base:           1rem;        /* 16px */
  --text-lg:             1.125rem;    /* 18px */
  --text-xl:             1.25rem;     /* 20px */
  --text-2xl:            1.5rem;      /* 24px */
  --text-3xl:            1.875rem;    /* 30px */
  --text-4xl:            2.25rem;     /* 36px */
  --text-5xl:            3rem;        /* 48px */
  --text-6xl:            3.75rem;     /* 60px */
  --text-7xl:            4.5rem;      /* 72px */

  /* Line heights                                                          */
  --leading-none:        1;
  --leading-tight:       1.1;
  --leading-snug:        1.25;
  --leading-normal:      1.5;
  --leading-relaxed:     1.625;
  --leading-loose:       1.75;

  /* Letter spacing                                                        */
  --tracking-tighter:    -0.03em;
  --tracking-tight:      -0.015em;
  --tracking-normal:     0;
  --tracking-wide:       0.04em;
  --tracking-wider:      0.08em;
  --tracking-widest:     0.12em;
  --tracking-luxury:     0.20em;   /* brand elements, labels */
  --tracking-spread:     0.30em;   /* section labels, eyebrows */

  /* Font weights                                                          */
  --weight-light:        300;
  --weight-regular:      400;
  --weight-medium:       500;
  --weight-semibold:     600;
  --weight-bold:         700;
  --weight-extrabold:    800;


  /* ── SPACING SCALE ──────────────────────────────────────────────────── */
  /* 4px base unit. Use these for padding, margin, gap.                   */

  --space-0:    0;
  --space-px:   1px;
  --space-0-5:  0.125rem;   /* 2px  */
  --space-1:    0.25rem;    /* 4px  */
  --space-1-5:  0.375rem;   /* 6px  */
  --space-2:    0.5rem;     /* 8px  */
  --space-3:    0.75rem;    /* 12px */
  --space-4:    1rem;       /* 16px */
  --space-5:    1.25rem;    /* 20px */
  --space-6:    1.5rem;     /* 24px */
  --space-8:    2rem;       /* 32px */
  --space-10:   2.5rem;     /* 40px */
  --space-12:   3rem;       /* 48px */
  --space-14:   3.5rem;     /* 56px */
  --space-16:   4rem;       /* 64px */
  --space-20:   5rem;       /* 80px */
  --space-24:   6rem;       /* 96px */
  --space-32:   8rem;       /* 128px */
  --space-40:   10rem;      /* 160px */
  --space-48:   12rem;      /* 192px */


  /* ── BORDER RADIUS ──────────────────────────────────────────────────── */

  --radius-none:  0;
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --radius-2xl:   24px;
  --radius-3xl:   32px;
  --radius-full:  9999px;


  /* ── SHADOWS ────────────────────────────────────────────────────────── */
  /* Dark theme shadows need high opacity to be visible                   */

  --shadow-xs:           0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm:           0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md:           0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:           0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-xl:           0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-2xl:          0 24px 64px rgba(0, 0, 0, 0.7);

  /* Gold glow shadows — for accent elements, focused inputs              */
  --shadow-gold-sm:      0 0 20px rgba(201, 168, 76, 0.06);
  --shadow-gold:         0 0 40px rgba(201, 168, 76, 0.08);
  --shadow-gold-lg:      0 0 60px rgba(201, 168, 76, 0.12);
  --shadow-gold-xl:      0 0 80px rgba(201, 168, 76, 0.18);

  /* Inset shadows — for inputs, wells                                    */
  --shadow-inner:        inset 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-inner-gold:   inset 0 0 12px rgba(201, 168, 76, 0.06);


  /* ── TRANSITIONS ────────────────────────────────────────────────────── */
  /* Pre-defined transitions for consistent motion                        */

  --ease-out:            cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:         cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring:         cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-fast:       120ms;
  --duration-base:       200ms;
  --duration-slow:       350ms;
  --duration-slower:     500ms;

  --transition-fast:     120ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base:     200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow:     350ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring:   500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-color:    color 200ms ease, background-color 200ms ease, border-color 200ms ease;


  /* ── LAYOUT ─────────────────────────────────────────────────────────── */

  --max-width-sm:        640px;
  --max-width-md:        768px;
  --max-width-lg:        1024px;
  --max-width-xl:        1200px;
  --max-width-2xl:       1400px;

  --nav-height:          72px;
  --sidebar-width:       280px;

  /* Z-index scale                                                         */
  --z-base:              0;
  --z-dropdown:          10;
  --z-sticky:            20;
  --z-overlay:           30;
  --z-modal:             40;
  --z-popover:           50;
  --z-toast:             60;
  --z-nav:               100;
}


/* ═══════════════════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--color-gold-a30);
  color: var(--color-text-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */

/* Headings — display font (Syne) with tight leading */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-text-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: clamp(var(--text-4xl), 7vw, var(--text-7xl));
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tighter);
  line-height: 1.05;
}

h2 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-tight);
}

h3 {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: var(--leading-snug);
}

p {
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

small {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-gold-light);
}

/* Utility classes for typography */
.text-display     { font-family: var(--font-display); }
.text-body        { font-family: var(--font-body); }
.text-mono        { font-family: var(--font-mono); }
.text-gold        { color: var(--color-gold); }
.text-muted       { color: var(--color-text-muted); }
.text-secondary   { color: var(--color-text-secondary); }

/* Luxury gradient text effect */
.text-gradient-gold {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 50%, var(--color-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Section label — small uppercase tracking */
.label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-spread);
  text-transform: uppercase;
  color: var(--color-gold-dim);
}

/* Caption text */
.caption {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}


/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENT BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */


/* ── BUTTONS ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — gold background, dark text */
.btn-primary {
  background: var(--color-gold);
  color: var(--color-bg-deep);
  border-color: var(--color-gold);
  font-weight: var(--weight-semibold);
}

.btn-primary:hover {
  background: var(--color-gold-light);
  border-color: var(--color-gold-light);
  box-shadow: var(--shadow-gold);
}

.btn-primary:active {
  background: var(--color-gold-dim);
  border-color: var(--color-gold-dim);
}

/* Secondary — outlined gold */
.btn-secondary {
  background: transparent;
  color: var(--color-gold);
  border-color: var(--color-gold-a30);
}

.btn-secondary:hover {
  background: var(--color-gold-a8);
  border-color: var(--color-gold);
  color: var(--color-gold-light);
}

.btn-secondary:active {
  background: var(--color-gold-a15);
}

/* Ghost — no border, subtle hover */
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.btn-ghost:active {
  background: var(--color-bg-surface);
}

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--color-error);
  border-color: rgba(248, 113, 113, 0.25);
}

.btn-danger:hover {
  background: var(--color-error-bg);
  border-color: var(--color-error);
}

/* Button sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

/* Icon-only button */
.btn-icon {
  padding: var(--space-2-5, 10px);
  aspect-ratio: 1;
  border-radius: var(--radius-md);
}


/* ── INPUTS ───────────────────────────────────────────────────────────── */

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--color-text-muted);
}

.input:hover {
  border-color: var(--color-border-light);
}

.input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px var(--color-gold-a12);
}

.input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--color-bg-elevated);
}

/* Input with error state */
.input-error {
  border-color: var(--color-error);
}

.input-error:focus {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

/* Textarea */
.textarea {
  min-height: 100px;
  resize: vertical;
}

/* Select */
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 5L6 8L9 5' stroke='%239a958a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
  cursor: pointer;
}

/* Label */
.input-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

/* Helper / error text */
.input-helper {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.input-error-text {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
}


/* ── CARDS ────────────────────────────────────────────────────────────── */

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  border-color: var(--color-border-gold);
}

/* Card with gold top accent line on hover */
.card-accent {
  position: relative;
}

.card-accent::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold-dim), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card-accent:hover::after {
  opacity: 1;
}

/* Elevated card (for modals, dropdowns) */
.card-elevated {
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-xl);
}

/* Card with gold glow */
.card-glow:hover {
  box-shadow: var(--shadow-gold);
}


/* ── MODALS ───────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
}

.modal {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}


/* ── BADGES ───────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  line-height: 1;
}

.badge-gold {
  background: var(--color-gold-a12);
  color: var(--color-gold-light);
  border-color: var(--color-gold-a20);
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-color: rgba(74, 222, 128, 0.2);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border-color: rgba(248, 113, 113, 0.2);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border-color: rgba(251, 191, 36, 0.2);
}

.badge-muted {
  background: var(--color-bg-surface);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}


/* ── DIVIDERS ─────────────────────────────────────────────────────────── */

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  border: none;
}

.divider-gold {
  background: linear-gradient(90deg, transparent, var(--color-gold-dim), transparent);
}

.divider-short {
  width: var(--space-12);
  height: 1px;
  background: var(--color-gold-dim);
  margin: var(--space-8) auto;
}


/* ── SCROLLBAR ────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-strong);
}


/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Visually hidden but accessible */
.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;
}

/* Focus ring for keyboard navigation */
.focus-ring:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-sm {
  max-width: var(--max-width-sm);
}

.container-md {
  max-width: var(--max-width-md);
}

.container-lg {
  max-width: var(--max-width-lg);
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS (Reference)
   ═══════════════════════════════════════════════════════════════════════════

   Mobile:      < 640px
   Tablet:      640px - 1023px    @media (min-width: 640px)
   Desktop:     1024px - 1399px   @media (min-width: 1024px)
   Wide:        >= 1400px         @media (min-width: 1400px)

   ═══════════════════════════════════════════════════════════════════════════ */
