/* ═══════════════════════════════════════════════
   CV Optimizer — Design System
   Shared tokens, base, and utility classes
═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Outfit:wght@300;400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

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

:root {
  /* ── Backgrounds ── */
  --bg:      #07080f;
  --bg1:     #0c0d1a;
  --bg2:     #111324;
  --bg3:     #161828;

  /* ── Borders ── */
  --border:  #1d2036;
  --border2: #272d48;

  /* ── Brand green ── */
  --green:        #4ade80;
  --green-dim:    rgba(74,222,128,.1);
  --green-glow:   rgba(74,222,128,.18);
  --green-border: rgba(74,222,128,.28);

  /* ── Semantic colors ── */
  --blue:     #60a5fa;
  --blue-dim: rgba(96,165,250,.1);
  --blue-bdr: rgba(96,165,250,.28);
  --amber:    #fbbf24;
  --amber-dim:rgba(251,191,36,.1);
  --rose:     #f87171;
  --rose-dim: rgba(248,113,113,.1);
  --rose-bdr: rgba(248,113,113,.28);

  /* ── Text ── */
  --text:  #e8edf8;
  --text2: #8892b8;
  --text3: #505878;

  /* ── Typography ── */
  --display: 'Syne', system-ui, sans-serif;
  --body:    'Outfit', system-ui, sans-serif;
  --mono:    'Space Mono', ui-monospace, monospace;

  /* ── Radius ── */
  --r:    8px;
  --r-sm: 5px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* ── Transitions ── */
  --t: .15s ease;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #3a4060; }

/* ── Focus rings (accessibility) ── */
:focus-visible {
  outline: 2px solid var(--green-border);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ── Skip link ── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background: var(--green);
  color: var(--bg);
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-sm);
  z-index: 9999;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

/* ── Toast system ── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  font-size: 13.5px;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  max-width: 320px;
  pointer-events: all;
  animation: toastIn .25s cubic-bezier(.22,.68,0,1.2) both;
}
.toast.exit { animation: toastOut .2s ease both; }
.toast.success { border-color: var(--green-border); }
.toast.error   { border-color: var(--rose-bdr); }
.toast-icon    { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
@keyframes toastIn  { from { opacity:0; transform:translateY(12px) scale(.95); } }
@keyframes toastOut { to   { opacity:0; transform:translateY(4px) scale(.97); } }

/* ── Loading spinner ── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

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