/* ============================================================
   OpenCard — Design Tokens
   SEO-портал по картам зарубежных банков
   ============================================================ */

/* Fonts loaded via <link> in each page (Inter + Manrope) */

:root {
  /* ---------- Brand / Accents ---------- */
  --brand-primary: #5B5BF5;
  --brand-primary-hover: #4848D6;
  --brand-accent: #0FB9B1;
  --brand-gradient: linear-gradient(120deg, #5B5BF5 0%, #7C5CFB 50%, #0FB9B1 100%);
  --brand-gradient-soft: linear-gradient(120deg, #EEF0FF 0%, #EAFBFA 100%);

  /* ---------- Neutrals ---------- */
  --ink-900: #0E1116;
  --ink-700: #2A2F3A;
  --ink-500: #5B6472;
  --ink-300: #9AA3B2;
  --surface-0: #FFFFFF;
  --surface-1: #F6F7FB;
  --surface-2: #EDEFF5;
  --border: #E3E6EE;

  /* ---------- Semantic ---------- */
  --success: #16A34A;
  --success-soft: #E8F6EE;
  --warning: #F59E0B;
  --warning-soft: #FEF4E2;
  --danger: #E11D48;
  --danger-soft: #FDE9EE;
  --rating-star: #FFB020;
  --info: #5B5BF5;
  --info-soft: #EEF0FF;

  /* ---------- Type ---------- */
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Manrope', 'Inter', system-ui, sans-serif;

  /* fluid display sizes (mobile -> desktop) */
  --fs-h1: clamp(34px, 4.2vw, 56px);
  --fs-h2: clamp(26px, 2.8vw, 40px);
  --fs-h3: clamp(20px, 1.9vw, 28px);
  --fs-h4: clamp(18px, 1.3vw, 20px);
  --fs-body-l: clamp(16px, 1.2vw, 18px);
  --fs-body-m: 16px;
  --fs-caption: 14px;
  --fs-overline: 12px;

  /* ---------- Spacing scale ---------- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* ---------- Radii ---------- */
  --r-btn: 12px;
  --r-input: 12px;
  --r-card: 16px;
  --r-block: 24px;
  --r-pill: 999px;

  /* ---------- Shadows ---------- */
  --shadow-sm: 0 1px 2px rgba(14,17,22,.06);
  --shadow-md: 0 8px 24px rgba(14,17,22,.08);
  --shadow-lg: 0 16px 48px rgba(14,17,22,.12);
  --shadow-ring: 0 0 0 3px rgba(91,91,245,.30);

  /* ---------- Layout ---------- */
  --container: 1200px;
  --pad-x: 24px;
  --header-h: 72px;
}

@media (max-width: 767px) {
  :root { --pad-x: 16px; --header-h: 60px; }
}

/* ============================================================
   Base reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-body-m);
  line-height: 1.6;
  color: var(--ink-700);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink-900); margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-h1); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: var(--fs-h3); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: var(--fs-h4); line-height: 1.3; font-weight: 600; }
p { margin: 0; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-primary-hover); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--shadow-ring); border-radius: 6px; }

/* ============================================================
   Layout helpers
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.tnum { font-variant-numeric: tabular-nums; }
.overline {
  font-size: var(--fs-overline);
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  border-radius: var(--r-btn);
  border: 1.5px solid transparent;
  padding: 0 20px;
  height: 40px;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .08s ease, box-shadow .16s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn--lg { height: 48px; padding: 0 26px; font-size: 16px; }
.btn--sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn--block { width: 100%; }

.btn--primary { background: var(--brand-primary); color: #fff; }
.btn--primary:hover { background: var(--brand-primary-hover); color: #fff; }
.btn--primary:focus-visible { box-shadow: var(--shadow-ring); }

.btn--secondary { background: var(--surface-0); border-color: var(--border); color: var(--ink-700); }
.btn--secondary:hover { border-color: var(--ink-300); background: var(--surface-1); color: var(--ink-900); }

.btn--ghost { background: transparent; color: var(--ink-700); }
.btn--ghost:hover { background: var(--surface-1); color: var(--ink-900); }

.btn--link { background: transparent; color: var(--brand-primary); padding: 0; height: auto; border: 0; }
.btn--link:hover { color: var(--brand-primary-hover); text-decoration: underline; }

.btn[disabled], .btn--disabled {
  opacity: .5; pointer-events: none;
}

/* Affiliate / referral CTA */
.btn--affiliate { background: var(--brand-primary); color: #fff; }
.btn--affiliate:hover { background: var(--brand-primary-hover); }
.btn--affiliate .ext { opacity: .85; }

/* ============================================================
   Badges / chips
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge--verified { background: var(--success-soft); color: var(--success); }
.badge--accent { background: #E4F8F6; color: #0A857F; }
.badge--popular { background: var(--info-soft); color: var(--brand-primary); }
.badge--warning { background: var(--warning-soft); color: #B45309; }
.badge--neutral { background: var(--surface-2); color: var(--ink-500); }
.badge--type { background: var(--surface-2); color: var(--ink-700); }

/* chips (filter / category) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  background: var(--surface-0);
  color: var(--ink-700);
  cursor: pointer;
  transition: all .14s ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-300); }
.chip--active { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.chip--active:hover { border-color: var(--ink-900); }
.chip--removable { padding-right: 8px; }
.chip__x { display: inline-flex; opacity: .6; }
.chip__x:hover { opacity: 1; }

/* ============================================================
   Cards / surfaces
   ============================================================ */
.card {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   Inputs
   ============================================================ */
.field {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  height: 48px;
  padding: 0 16px;
  background: var(--surface-0);
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.field:focus-within { border-color: var(--brand-primary); box-shadow: var(--shadow-ring); }
.field input, .field select {
  border: 0; outline: 0; background: transparent; width: 100%;
  font-family: var(--font-ui); font-size: 15px; color: var(--ink-900);
}
.field input::placeholder { color: var(--ink-300); }
.field svg { width: 20px; height: 20px; color: var(--ink-500); flex: none; }

/* ============================================================
   Star rating
   ============================================================ */
.stars { display: inline-flex; gap: 2px; color: var(--rating-star); }
.stars svg { width: 16px; height: 16px; }

/* ============================================================
   Alert / info block
   ============================================================ */
.alert {
  display: flex;
  gap: var(--s-3);
  padding: 16px;
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.55;
}
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert--info { background: var(--info-soft); border-color: #D9DDFF; color: #2D2F8F; }
.alert--info svg { color: var(--brand-primary); }
.alert--warning { background: var(--warning-soft); border-color: #FBE2B5; color: #92500B; }
.alert--warning svg { color: var(--warning); }

/* ============================================================
   Utilities
   ============================================================ */
.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;
}
.muted { color: var(--ink-500); }
.faint { color: var(--ink-300); }
