/* =====================================================================
   VROOM App Design System — Exaggerated Minimalism
   ===================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap");

:root {
  /* ================================================================== */
  /* PRIMARY PALETTE                                                    */
  /* ================================================================== */
  --yx-black:         #000000;
  --yx-white:         #FFFFFF;
  --color-primary:    #2563EB;
  --color-secondary:  #3B82F6;
  --color-cta:        #F97316;
  --color-background: #EFF6FF;
  --color-text:       #1E40AF;

  /* Legacy overrides to ensure everything inherits correctly without breaking */
  --yx-royal-blue:    var(--color-primary);
  --yx-orange:        var(--color-cta);
  --app-bg:           var(--color-background);
  --app-bg-subtle:    #F7FAFB;
  --app-bg-muted:     #E2E8F0;
  --app-card:         #FFFFFF;
  --app-card-hover:   #F8FAFC;
  
  --app-fg:           var(--color-text);
  --app-fg-muted:     #475569;
  --app-fg-link:      var(--color-primary);

  --app-border:       #E2E8F0;

  /* ================================================================== */
  /* TYPOGRAPHY                                                         */
  /* ================================================================== */
  --font-display: 'Fira Code', monospace;
  --font-body: 'Fira Sans', sans-serif;

  --fs-hero:     clamp(3rem, 10vw, 12rem);
  --fs-h1:       56px;
  --fs-h2:       40px;
  --fs-h3:       24px;
  --fs-h4:       20px;
  --fs-body:     16px;
  --fs-small:    14px;
  --fs-xs:       12px;

  --tracking-tight: -0.05em;
  
  /* ================================================================== */
  /* SPACING & LAYOUT                                                   */
  /* ================================================================== */
  --space-1:     4px;
  --space-2:     8px;
  --space-3:     12px;
  --space-4:     16px;
  --space-5:     24px;
  --space-6:     32px;
  --space-7:     48px;
  --space-8:     64px;

  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-pill: 9999px;

  /* ================================================================== */
  /* SHADOWS & EFFECTS                                                  */
  /* ================================================================== */
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:   0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg:   0 10px 15px rgba(0,0,0,0.1);
  --shadow-xl:   0 20px 25px rgba(0,0,0,0.15);

  --dur-base:    200ms;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);

  /* Status */
  --app-success:         #00E38C;
  --app-warning:         #FFE564;
  --app-danger:          #F47738;
  --app-info:            #9DBBFF;

  /* ================================================================== */
  /* TYPOGRAPHY                                                         */
  /* ================================================================== */
  --font-display: "Manrope", "Jeko", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "Inter", monospace;

  /* Type scale - Fluid typography */
  --fs-display:   clamp(48px, 6vw, 72px);
  --fs-h1:        clamp(36px, 5vw, 56px);
  --fs-h2:        clamp(28px, 4vw, 40px);
  --fs-h3:        clamp(22px, 3vw, 28px);
  --fs-h4:        clamp(18px, 2vw, 22px);
  --fs-lead:      clamp(16px, 1.5vw, 20px);
  --fs-body:      16px; /* Base remains static for readability */
  --fs-small:     14px;
  --fs-micro:     12px;

  /* Line heights */
  --lh-tight:     1.05;
  --lh-snug:      1.2;
  --lh-normal:    1.5;
  --lh-relaxed:   1.6;

  /* Letter spacing */
  --tracking-tight:  -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-caps:    0.08em;

  /* ================================================================== */
  /* SPACING                                                            */
  /* ================================================================== */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   48px;
  --space-8:   64px;
  --space-9:   96px;
  --space-10:  128px;

  /* ================================================================== */
  /* RADII                                                              */
  /* ================================================================== */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-pill: 999px;

  /* ================================================================== */
  /* SHADOWS — cool-tinted, never warm grey                             */
  /* ================================================================== */
  --shadow-sm:   0 1px 2px rgba(15, 28, 64, 0.06);
  --shadow-md:   0 6px 16px rgba(15, 28, 64, 0.08);
  --shadow-lg:   0 18px 48px rgba(15, 28, 64, 0.12);
  --shadow-glow: 0 0 0 4px rgba(30, 46, 217, 0.15);

  /* ================================================================== */
  /* MOTION — confident, never bouncy                                   */
  /* ================================================================== */
  --ease-out:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:    140ms;
  --dur-base:    220ms;
  --dur-slow:    360ms;
}

/* =====================================================================
   ELEMENT DEFAULTS
   ===================================================================== */

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  color: var(--app-fg);
  background: var(--app-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, .display, .headline {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  color: var(--app-fg);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

.display { font-size: var(--fs-display); }
h1       { font-size: var(--fs-h1); }
h2       { font-size: var(--fs-h2); }
h3       { font-size: var(--fs-h3); line-height: var(--lh-snug); }
h4       { font-size: var(--fs-h4); line-height: var(--lh-snug); }

p {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  margin: 0 0 var(--space-4);
  text-wrap: pretty;
}

small, .small { font-size: var(--fs-small); }

/* Inline highlight — Royal Blue only */
.hl, mark.hl {
  color: var(--app-fg-highlight);
  background: transparent;
  font-weight: 500;
}

a {
  color: var(--app-fg-link);
  text-decoration: none;
  transition: opacity var(--dur-fast) var(--ease-out);
}
a:hover { opacity: 0.7; }

/* =====================================================================
   COMPONENT PRIMITIVES — Buttons
   ===================================================================== */

/* Primary: black bg, white text, Royal Blue on hover */
.yx-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-small);
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: 0;
  transition: all var(--dur-fast) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.yx-btn-primary {
  background: var(--yx-black);
  color: var(--yx-white);
}
.yx-btn-primary:hover {
  background: var(--yx-royal-blue);
}

.yx-btn-secondary {
  background: var(--yx-white);
  color: var(--yx-black);
  border-color: var(--yx-black);
}
.yx-btn-secondary:hover {
  background: var(--yx-black);
  color: var(--yx-white);
}

.yx-btn-ghost {
  background: transparent;
  color: var(--app-fg-muted);
  border-color: var(--app-border);
}
.yx-btn-ghost:hover {
  background: var(--app-bg-subtle);
  color: var(--app-fg);
  border-color: var(--app-border-strong);
}

.yx-btn-link {
  background: transparent;
  color: var(--yx-royal-blue);
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid var(--yx-royal-blue);
  border-radius: 0;
}

.yx-btn-grad {
  background: var(--yx-grad-deep-blue);
  color: var(--yx-white);
}

.yx-btn-sm { font-size: 13px; padding: 8px 14px; }
.yx-btn-lg { font-size: 15px; padding: 14px 26px; }

.yx-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Arrow helper for CTAs */
.yx-arrow {
  display: inline-block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  position: relative;
}
.yx-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

/* =====================================================================
   COMPONENT PRIMITIVES — Badges & Tags
   ===================================================================== */

.yx-badge {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-micro);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.yx-badge-dark    { background: var(--yx-black);     color: var(--yx-white); }
.yx-badge-light   { background: var(--yx-gray);      color: var(--yx-black); }
.yx-badge-outline { background: var(--yx-white);     color: var(--yx-black); border: 1px solid var(--yx-black); }
.yx-badge-blue    { background: var(--yx-royal-blue); color: var(--yx-white); }
.yx-badge-success { background: var(--yx-green);     color: var(--yx-black); }
.yx-badge-warn    { background: var(--yx-yellow);    color: var(--yx-black); }
.yx-badge-danger  { background: var(--yx-orange);    color: var(--yx-black); }

.yx-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.yx-tag {
  font-size: 11px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--yx-royal-blue);
  font-weight: 600;
}

/* =====================================================================
   COMPONENT PRIMITIVES — Cards
   ===================================================================== */

.yx-card {
  background: var(--app-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--app-border);
  transition: box-shadow var(--dur-base) var(--ease-out);
}

.yx-card:hover {
  box-shadow: var(--shadow-md);
}

.yx-card-dark {
  background: var(--yx-black);
  color: var(--yx-white);
  border: 0;
}

/* =====================================================================
   COMPONENT PRIMITIVES — Inputs
   ===================================================================== */

.yx-field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--app-fg-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.yx-field input,
.yx-field select,
.yx-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--yx-black);
  border-radius: var(--radius-md);
  background: var(--yx-white);
  color: var(--yx-black);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.yx-field input:focus,
.yx-field select:focus,
.yx-field textarea:focus {
  border-color: var(--yx-royal-blue);
  box-shadow: var(--shadow-glow);
}

.yx-field input::placeholder {
  color: #9aa3a8;
}

/* =====================================================================
   COMPONENT PRIMITIVES — Stats
   ===================================================================== */

.yx-stat .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 54px;
  letter-spacing: -0.025em;
  line-height: 1;
}

.yx-stat .num .plus {
  color: var(--yx-royal-blue);
}

.yx-stat .label {
  font-size: 13px;
  color: var(--app-fg-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* =====================================================================
   GRADIENT TEXT HELPERS
   ===================================================================== */

.text-grad-silver {
  background: var(--yx-grad-silver);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-grad-deep-blue {
  background: var(--yx-grad-deep-blue);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =====================================================================
   UTILITY CLASSES
   ===================================================================== */

.yx-text-muted  { color: var(--app-fg-muted); }
.yx-text-soft   { color: var(--app-fg-soft); }
.yx-text-link   { color: var(--app-fg-link); }
.yx-text-on-dark { color: var(--app-fg-on-dark); }

.yx-bg-silver   { background: var(--yx-grad-silver); }
.yx-bg-frosted  { background: var(--yx-grad-frosted); }
.yx-bg-spring   { background: var(--yx-grad-spring); }
.yx-bg-deep-blue { background: var(--yx-grad-deep-blue); }
