/* ========================================
   MCC Design System Tokens v3.0
   Clean, flat, professional IT tool
   ======================================== */

:root {
  /* ============ COLOR SYSTEM ============ */
  --color-primary: #0078D4;
  --color-primary-hover: #106EBE;
  --color-primary-light: #DEECF9;
  --color-primary-dark: #004578;
  --color-primary-text: #ffffff;

  /* Semantic */
  --color-success: #107C10;
  --color-success-light: #DFF6DD;
  --color-error: #D13438;
  --color-error-light: #FDE7E9;
  --color-warning: #FF8C00;
  --color-warning-light: #FFF4CE;
  --color-info: #0078D4;
  --color-info-light: #DEECF9;

  /* Status */
  --color-pending: #8A8886;
  --color-processing: #0078D4;
  --color-completed: #107C10;
  --color-failed: #D13438;

  /* Text — solid, readable */
  --color-text-primary: #000000;
  --color-text-secondary: #404040;
  --color-text-tertiary: #808080;
  --color-text-disabled: #a0a0a0;
  --color-text-inverse: #ffffff;

  /* Surfaces — Win98 beige/silver */
  --color-bg-canvas: #d4d0c8;
  --color-bg-primary: #ece9d8;
  --color-bg-secondary: #d4d0c8;
  --color-bg-tertiary: #c0c0c0;
  --color-bg-hover: #dbd7ce;
  --color-bg-sidebar: #d4d0c8;
  --color-bg-header: #ece9d8;

  /* Borders — industrial gray */
  --color-border: #a0a0a0;
  --color-border-light: #c0beb8;
  --color-border-dark: #808080;
  --color-border-focus: #0078D4;

  /* Action borders for cards */
  --color-action-blue: #0078D4;
  --color-action-green: #107C10;
  --color-action-teal: #00B7C3;
  --color-action-purple: #5C2D91;
  --color-action-red: #D13438;
  --color-action-orange: #FF8C00;
  --color-action-pink: #E3008C;
  --color-action-gray: #605e5c;

  /* ============ SPACING (4px base) ============ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ============ TYPOGRAPHY ============ */
  --font-family-primary: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-family-display: 'Inter', -apple-system, sans-serif;
  --font-family-monospace: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;

  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 13px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 22px;
  --font-size-3xl: 26px;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* ============ SHADOWS (subtle, professional) ============ */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.06), 0 4px 6px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.08), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-focus: 0 0 0 2px rgba(0, 120, 212, 0.3);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);

  /* ============ BORDER RADIUS ============ */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* ============ Z-INDEX ============ */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 1000;
  --z-modal: 1001;
  --z-toast: 2000;

  /* ============ TRANSITIONS ============ */
  --transition-fast: 120ms ease;
  --transition-medium: 200ms ease;
  --transition-slow: 350ms ease;

  /* ============ SIDEBAR ============ */
  --sidebar-width: 240px;
  --sidebar-collapsed: 60px;
}

/* ============ DARK MODE ============ */
[data-theme="dark"] {
  --color-primary: #4DA8FF;
  --color-primary-hover: #3B96E8;
  --color-primary-light: #1a3352;
  --color-primary-text: #ffffff;

  --color-success: #4CAF50;
  --color-success-light: #1a331a;
  --color-error: #F44336;
  --color-error-light: #331a1a;
  --color-warning: #FFA726;
  --color-warning-light: #332a1a;
  --color-info: #4DA8FF;
  --color-info-light: #1a3352;

  --color-text-primary: #e4e4e8;
  --color-text-secondary: #a8a8b0;
  --color-text-tertiary: #6e6e78;
  --color-text-disabled: #505058;

  --color-bg-canvas: #111114;
  --color-bg-primary: #1a1a1f;
  --color-bg-secondary: #222228;
  --color-bg-tertiary: #2c2c33;
  --color-bg-hover: #32323a;
  --color-bg-sidebar: #16161a;
  --color-bg-header: #1a1a1f;

  --color-border: #333338;
  --color-border-light: #28282d;
  --color-border-dark: #444449;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 12px 28px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ============================================================
   MOTION + PREVIEW POLISH v2  (refined, restrained, token-driven)
   ============================================================ */

/* Modal entrance — subtle fade + rise, quick ease-out (no jank) */
.modal-content { animation: ob-modal-in 180ms cubic-bezier(0.16, 0.84, 0.44, 1); }
@keyframes ob-modal-in {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Consistent, specific interaction transitions (never `all`) */
button, .btn-primary, .btn-secondary, .btn-sm, .nav-item, input, select, textarea, .close {
    transition: background-color 140ms ease, border-color 140ms ease,
                color 140ms ease, box-shadow 140ms ease, transform 100ms ease;
}
button:active, .btn-primary:active, .btn-secondary:active, .btn-sm:active { transform: translateY(1px); }

/* Cards feel responsive */
.card { transition: box-shadow 160ms ease, transform 160ms ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }

/* Clear keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm);
}

/* ---- Request Preview modal (matches form-modal rhythm) ---- */
.preview-hero {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: var(--radius-md);
    background: var(--color-bg-tertiary); margin-bottom: 20px;
}
.preview-hero-icon { font-size: 24px; }
.preview-hero-main { min-width: 0; }
.preview-hero-name { font-size: 18px; font-weight: 700; color: var(--color-text-primary); }
.preview-hero-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.preview-hero-company { font-size: 12px; color: var(--color-text-secondary); }
.preview-hero-score { margin-left: auto; text-align: right; }
.preview-score-num { font-size: 22px; font-weight: 700; line-height: 1; }
.preview-score-label { font-size: 10px; color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.status-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.03em; }
.preview-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 7px 0; border-bottom: 1px solid var(--color-border-light); font-size: 13px;
}
.preview-row:last-child { border-bottom: none; }
.preview-row-label { color: var(--color-text-tertiary); font-weight: 500; min-width: 130px; }
.preview-row-value { color: var(--color-text-primary); font-weight: 600; text-align: right; word-break: break-all; }
.preview-row-value.mono { font-family: var(--font-family-monospace); font-size: 12px; }
.preview-ai-note { font-size: 12px; color: var(--color-text-secondary); padding: 4px 0; display: flex; gap: 6px; align-items: flex-start; }
.preview-ai-note .material-icons { font-size: 14px; color: var(--color-warning); flex-shrink: 0; }

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