/* ==========================================================================
   strahovka.css — Single source of CSS for strahovka.ru
   Stack: Tailwind CSS 3 (CDN, utility classes) + Alpine.js 3 (CDN)
   This file: custom tokens, components, utilities BEYOND Tailwind
   ========================================================================== */

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ========================================================================== */

:root {
  /* --- Brand Colors --- */
  --c-primary:       #1a56db;
  --c-primary-dark:  #1e429f;
  --c-primary-light: #ebf5ff;
  --c-trust:         #057a55;
  --c-trust-dark:    #046c4e;
  --c-trust-light:   #f0fdf4;
  --c-warning:       #d97706;
  --c-warning-light: #fffbeb;
  --c-danger:        #dc2626;
  --c-danger-light:  #fef2f2;

  /* --- Shadows --- */
  --shadow-card:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-raised: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-float:  0 8px 32px rgba(0,0,0,.10), 0 4px 10px rgba(0,0,0,.06);
  --shadow-hero:   0 20px 60px rgba(26,86,219,.16), 0 6px 20px rgba(26,86,219,.08);
  --shadow-inset:  inset 0 2px 6px rgba(0,0,0,.06);

  /* --- Border Radius --- */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 24px;

  /* --- Transitions --- */
  --t-fast: 150ms ease;
  --t-base: 200ms ease;
  --t-slow: 300ms ease;

  /* --- Section Spacing --- */
  --section-py:    5rem;
  --section-py-sm: 3rem;
}


/* ==========================================================================
   2. BASE / RESET
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Alpine.js — hide elements until Alpine initialises */
[x-cloak] {
  display: none !important;
}

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

/* Remove default list styling when semantic lists are used as UI */
ul.list-unstyled,
ol.list-unstyled {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

/* Smooth focus outlines */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}


/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

.h1 {
  font-size: 2.5rem;
  line-height: 3rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #111827;
}

.h2 {
  font-size: 2rem;
  line-height: 2.5rem;
  font-weight: 700;
  letter-spacing: -.015em;
  color: #111827;
}

.h3 {
  font-size: 1.5rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: #111827;
}

.h4 {
  font-size: 1.25rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: #111827;
}

.text-lead {
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: #4b5563;
}

.text-caption {
  font-size: .75rem;
  line-height: 1.25rem;
  color: #6b7280;
}

.text-mono {
  font-family: 'Courier New', Courier, monospace;
  font-size: .75rem;
}

/* Responsive typography breakpoints */
@media (max-width: 768px) {
  .h1 { font-size: 1.875rem; line-height: 2.375rem; }
  .h2 { font-size: 1.5rem;   line-height: 2rem; }
  .h3 { font-size: 1.25rem;  line-height: 1.625rem; }
}


/* ==========================================================================
   4. SHADOW UTILITIES
   ========================================================================== */

.shadow-card   { box-shadow: var(--shadow-card); }
.shadow-raised { box-shadow: var(--shadow-raised); }
.shadow-float  { box-shadow: var(--shadow-float); }
.shadow-hero   { box-shadow: var(--shadow-hero); }
.shadow-inset  { box-shadow: var(--shadow-inset); }


/* ==========================================================================
   5. LAYOUT HELPERS
   ========================================================================== */

/* Full-width section wrapper */
.section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
  overflow-x: hidden;
}

.section-sm {
  padding-top: var(--section-py-sm);
  padding-bottom: var(--section-py-sm);
  overflow-x: hidden;
}

/* Centred max-width container */
.container-site {
  width: 100%;
  max-width: 80rem; /* 1280px */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-site { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  .container-site { padding-left: 2rem; padding-right: 2rem; }
}

/* Product grid — 2 cols → 3 cols → 4 cols */
.grid-products {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .grid-products { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .grid-products { grid-template-columns: repeat(4, 1fr); }
}

/* Blog grid — 1 col → 2 col → 3 col */
.grid-blog {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-blog { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-blog { grid-template-columns: repeat(3, 1fr); }
}


/* ==========================================================================
   6. HEADER
   ========================================================================== */

/* Frosted glass effect for sticky header */
.header-blur {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

/* Top navigation link */
.header-nav-link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .625rem;
  font-size: .875rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}

.header-nav-link:hover {
  color: var(--c-primary);
  background: var(--c-primary-light);
}

.header-nav-link.active {
  color: var(--c-primary);
  font-weight: 600;
  background: var(--c-primary-light);
}


/* ==========================================================================
   7. HERO SECTIONS
   ========================================================================== */

/* Light mesh — default landing hero */
.hero-mesh {
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 40%, #f8f4ff 100%);
}

/* Dark insurance hero */
.hero-dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e1b4b 100%);
  color: white;
}

/* Green trust gradient */
.hero-trust {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 40%, #ecfdf5 100%);
}

/* Finance / yellow-blue gradient */
.hero-finance {
  background: linear-gradient(135deg, #fefce8 0%, #ffffff 40%, #f0f9ff 100%);
}


/* ==========================================================================
   8. CARDS
   ========================================================================== */

/* --- Base card --- */
.card {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, .06);
}

/* Elevated card */
.card-raised {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-raised);
  border: 1px solid rgba(0, 0, 0, .06);
}

/* Card that lifts on hover */
.card-lift {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, .06);
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.card-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

/* Policy card — accent left border driven by data-status */
.card-policy {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, .06);
  border-left: 3px solid #e5e7eb;
  transition: box-shadow var(--t-base);
}

.card-policy:hover {
  box-shadow: var(--shadow-raised);
}

.card-policy[data-status="active"] {
  border-left-color: var(--c-trust);
}

.card-policy[data-status="expiring"] {
  border-left-color: var(--c-warning);
}

.card-policy[data-status="expired"] {
  border-left-color: #9ca3af;
  opacity: .75;
}

/* Insurer logo card */
.card-insurer {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, .06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.card-insurer:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
}

/* Stat card — icon + large number + label */
.card-stat {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, .06);
  padding: 1.25rem 1.5rem;
}

.card-stat .stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.card-stat .stat-label {
  font-size: .8125rem;
  color: #6b7280;
  margin-top: .25rem;
}

/* Blog / article preview card */
.card-blog {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, .06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.card-blog:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
}

.card-blog .card-blog-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f3f4f6;
}

.card-blog .card-blog-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}


/* ==========================================================================
   9. BUTTONS
   ========================================================================== */

/* --- Base button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  border: none;
  outline: none;
  transition: background var(--t-fast), color var(--t-fast),
              box-shadow var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

/* Primary */
.btn-primary {
  background: var(--c-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--c-primary-dark);
  box-shadow: 0 4px 12px rgba(26,86,219,.3);
}

/* Secondary / outline */
.btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* Trust / green */
.btn-trust {
  background: var(--c-trust);
  color: white;
}

.btn-trust:hover {
  background: var(--c-trust-dark);
  box-shadow: 0 4px 12px rgba(5,122,85,.3);
}

/* Danger */
.btn-danger {
  background: var(--c-danger);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 12px rgba(220,38,38,.3);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--c-primary);
  border: none;
}

.btn-ghost:hover {
  background: var(--c-primary-light);
}

/* Sizes */
.btn-sm {
  padding: .375rem .75rem;
  font-size: .75rem;
  border-radius: 6px;
}

.btn-lg {
  padding: .875rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--r-md);
}

.btn-xl {
  padding: 1rem 2rem;
  font-size: 1.0625rem;
  border-radius: var(--r-lg);
}

/* Full-width */
.btn-block {
  width: 100%;
  justify-content: center;
}

/* Disabled state */
.btn[disabled],
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading state — spinner appended after text */
.btn.loading {
  pointer-events: none;
  opacity: .8;
}

.btn.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: .375rem;
  flex-shrink: 0;
}


/* ==========================================================================
   10. FORM ELEMENTS
   ========================================================================== */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: .375rem;
}

.form-label .required {
  color: var(--c-danger);
  margin-left: .25rem;
}

/* Base input / textarea */
.form-input {
  width: 100%;
  padding: .625rem .875rem;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--r-sm);
  font-size: .875rem;
  color: #111827;
  background: white;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  line-height: 1.5;
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, .12);
}

.form-input.error {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .10);
}

.form-input.success {
  border-color: var(--c-trust);
  box-shadow: 0 0 0 3px rgba(5, 122, 85, .10);
}

.form-input:disabled {
  background: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Select — inherits input styles + custom arrow */
.form-select {
  width: 100%;
  padding: .625rem .875rem;
  padding-right: 2.5rem;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--r-sm);
  font-size: .875rem;
  color: #111827;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E") no-repeat right .625rem center / 1.25rem;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, .12);
}

/* Hint and error messages */
.form-hint {
  font-size: .75rem;
  color: #6b7280;
  margin-top: .25rem;
  line-height: 1.4;
}

.form-error {
  font-size: .75rem;
  color: var(--c-danger);
  margin-top: .25rem;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: .25rem;
}

/* Toggle / Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 2.5rem;
  height: 1.375rem;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #e5e7eb;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-base);
}

.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: left var(--t-base);
}

.toggle input:checked + .toggle-track {
  background: var(--c-primary);
}

.toggle input:checked + .toggle-track::after {
  left: calc(100% - 1.25rem);
}

/* Range input */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(26, 86, 219, .4);
  transition: transform var(--t-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(26, 86, 219, .4);
}

/* Password strength bar */
.strength-bar {
  height: 4px;
  border-radius: 2px;
  transition: width .3s ease, background .3s ease;
}

.strength-bar[data-level="1"] { background: var(--c-danger);  width: 25%; }
.strength-bar[data-level="2"] { background: var(--c-warning); width: 50%; }
.strength-bar[data-level="3"] { background: #16a34a;          width: 75%; }
.strength-bar[data-level="4"] { background: var(--c-trust);   width: 100%; }


/* ==========================================================================
   11. BADGES / PILLS / TAGS
   ========================================================================== */

/* Base badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .625rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

/* Colour variants */
.badge-primary  { background: var(--c-primary-light); color: var(--c-primary); }
.badge-trust    { background: linear-gradient(135deg, var(--c-trust), #059669); color: white; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-gray     { background: #f3f4f6; color: #6b7280; }

/* Policy status badges */
.badge-active   { background: #d1fae5; color: #065f46; }
.badge-expiring { background: #fef3c7; color: #92400e; }
.badge-expired  { background: #f3f4f6; color: #6b7280; }

/* KBM score badge */
.badge-kbm {
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  color: #1e429f;
  font-weight: 700;
  font-size: .8125rem;
}

/* New / Featured gradient badge */
.badge-new {
  background: linear-gradient(135deg, var(--c-primary), #7c3aed);
  color: white;
}

/* Larger removable tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .75rem;
  border-radius: var(--r-sm);
  font-size: .8125rem;
  font-weight: 500;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.tag .tag-remove {
  cursor: pointer;
  color: #9ca3af;
  line-height: 1;
  transition: color var(--t-fast);
}

.tag .tag-remove:hover {
  color: var(--c-danger);
}


/* ==========================================================================
   12. NAVIGATION
   ========================================================================== */

/* --- Breadcrumbs --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.breadcrumb-item {
  font-size: .8125rem;
  color: #6b7280;
}

.breadcrumb-item a {
  color: #6b7280;
  text-decoration: none;
  transition: color var(--t-fast);
}

.breadcrumb-item a:hover {
  color: var(--c-primary);
}

.breadcrumb-sep {
  color: #d1d5db;
  user-select: none;
}

.breadcrumb-item.current {
  color: #374151;
  font-weight: 500;
}

/* --- Tabs (product / comparison) --- */
.tabs {
  display: flex;
  gap: .25rem;
  background: #f3f4f6;
  padding: .25rem;
  border-radius: var(--r-md);
  overflow-x: auto;
}

.tab-item {
  padding: .5rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-base);
  color: #6b7280;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.tab-item.active {
  background: white;
  color: var(--c-primary);
  box-shadow: var(--shadow-card);
  font-weight: 600;
}

.tab-item:hover:not(.active) {
  color: #374151;
  background: rgba(255, 255, 255, .6);
}

/* --- Sidebar navigation (LK) --- */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .75rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  color: #6b7280;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
  user-select: none;
}

.sidebar-link:hover {
  background: #f9fafb;
  color: #111827;
}

.sidebar-link.active {
  background: var(--c-primary-light);
  color: var(--c-primary);
  font-weight: 600;
}

/* Notification count badge inside sidebar link */
.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--c-primary-light);
  color: var(--c-primary);
  font-size: .625rem;
  font-weight: 700;
  padding: .125rem .4rem;
  border-radius: 999px;
  line-height: 1.4;
}


/* ==========================================================================
   13. ALERTS / NOTIFICATIONS
   ========================================================================== */

.alert {
  display: flex;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: .875rem;
  line-height: 1.5;
}

.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-success { background: var(--c-trust-light); border-color: #a7f3d0; color: #065f46; }
.alert-warning { background: var(--c-warning-light); border-color: #fde68a; color: #92400e; }
.alert-danger  { background: var(--c-danger-light); border-color: #fecaca; color: #991b1b; }

/* eCom / Advertising disclosure (FZ-347 compliance) */
.alert-erid {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
  font-size: .75rem;
}

/* ERID notice at bottom of ad cards (required by Russian ad law FZ-347) */
.erid-notice {
  font-size: .6875rem;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
  padding-top: .5rem;
  margin-top: .75rem;
  line-height: 1.5;
}


/* ==========================================================================
   14. TABLES
   ========================================================================== */

.table-base {
  width: 100%;
  font-size: .875rem;
  border-collapse: collapse;
}

.table-base thead {
  background: #f9fafb;
}

.table-base th {
  text-align: left;
  padding: .75rem 1rem;
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

.table-base td {
  padding: .875rem 1rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.table-base tbody tr:hover {
  background: #f9fafb;
}

.table-base tbody tr:last-child td {
  border-bottom: none;
}

/* Comparison table */
.table-compare .winner-cell {
  background: #f0fdf4;
  font-weight: 600;
  color: #065f46;
}

.table-compare .loser-cell {
  color: #9ca3af;
}

/* Freeze first column on mobile scroll */
.table-compare th:first-child,
.table-compare td:first-child {
  position: sticky;
  left: 0;
  background: white;
  z-index: 1;
}

.table-compare thead th:first-child {
  background: #f9fafb;
}

/* Mobile horizontal scroll wrapper */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* ==========================================================================
   15. PROGRESS / STEPS (checkout flow)
   ========================================================================== */

.steps {
  display: flex;
  align-items: flex-start;
}

.step {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}

.step-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step.completed .step-circle {
  background: var(--c-trust);
  color: white;
}

.step.active .step-circle {
  background: var(--c-primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(26, 86, 219, .2);
}

.step.pending .step-circle {
  background: #f3f4f6;
  color: #9ca3af;
  border: 2px solid #e5e7eb;
}

.step-label {
  font-size: .75rem;
  font-weight: 500;
  color: #6b7280;
  text-align: center;
}

.step.active .step-label,
.step.completed .step-label {
  color: #374151;
}

/* Connecting line between steps */
.step-line {
  position: absolute;
  top: 1.25rem;
  left: calc(50% + 1.375rem);
  right: calc(-50% + 1.375rem);
  height: 2px;
  background: #e5e7eb;
}

.step.completed .step-line {
  background: var(--c-trust);
}

/* Hide line for last step */
.step:last-child .step-line {
  display: none;
}


/* ==========================================================================
   16. MODALS / OVERLAYS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal {
  background: white;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
  max-width: 28rem;
  width: 100%;
  padding: 2rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-lg {
  max-width: 42rem;
}

.modal-xl {
  max-width: 56rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #9ca3af;
  cursor: pointer;
  padding: .25rem;
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
  border: none;
  background: transparent;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f3f4f6;
}


/* ==========================================================================
   17. REFERRAL-SPECIFIC COMPONENTS
   ========================================================================== */

/* Link/code share box */
.ref-link-box {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--r-md);
  padding: .875rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.ref-link-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: .875rem;
  font-weight: 600;
  color: var(--c-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Referral hierarchy tree */
.ref-tree-node {
  position: relative;
  padding-left: 2rem;
}

.ref-tree-node::before {
  content: '';
  position: absolute;
  left: .875rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}

.ref-tree-node:last-child::before {
  height: 1.5rem;
}

.ref-tree-node::after {
  content: '';
  position: absolute;
  left: .875rem;
  top: 1.5rem;
  width: .75rem;
  height: 2px;
  background: #e5e7eb;
}

/* Commission earned display */
.commission-badge {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: .5rem 1rem;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 1.25rem;
  display: inline-block;
}

/* Payout status text colours */
.payout-pending    { color: var(--c-warning); }
.payout-paid       { color: var(--c-trust); }
.payout-chargeback { color: var(--c-danger); }


/* ==========================================================================
   18. AGENT-SPECIFIC COMPONENTS
   ========================================================================== */

/* Agent level / tier badge */
.agent-level {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .375rem .875rem;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
}

.agent-level-bronze  { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.agent-level-silver  { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); color: #475569; }
.agent-level-gold    { background: linear-gradient(135deg, #fef9c3, #fde047); color: #854d0e; }
.agent-level-platinum { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #4c1d95; }

/* KV (komisionnoe voznagrazhdenie) progress bar */
.kv-progress {
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
  overflow: hidden;
}

.kv-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), #6366f1);
  border-radius: 4px;
  transition: width .6s ease;
  min-width: 4px;
}

/* Individual sales funnel stage */
.funnel-step {
  background: white;
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--c-primary);
  box-shadow: var(--shadow-card);
}

.funnel-step[data-stage="lead"]     { border-left-color: #6b7280; }
.funnel-step[data-stage="contact"]  { border-left-color: var(--c-primary); }
.funnel-step[data-stage="quote"]    { border-left-color: var(--c-warning); }
.funnel-step[data-stage="payment"]  { border-left-color: #8b5cf6; }
.funnel-step[data-stage="issued"]   { border-left-color: var(--c-trust); }


/* ==========================================================================
   19. SEO CONTENT BLOCKS
   ========================================================================== */

/* --- FAQ accordion --- */
.faq-item {
  border-bottom: 1px solid #f3f4f6;
}

.faq-item:first-child {
  border-top: 1px solid #f3f4f6;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.125rem 0;
  cursor: pointer;
  font-weight: 500;
  font-size: .9375rem;
  color: #111827;
  gap: 1rem;
  list-style: none;
  user-select: none;
}

.faq-question:hover {
  color: var(--c-primary);
}

.faq-question .faq-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: #9ca3af;
  transition: transform var(--t-base);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--c-primary);
}

.faq-answer {
  padding-bottom: 1.125rem;
  font-size: .9375rem;
  color: #4b5563;
  line-height: 1.7;
}

/* --- Callout / tip boxes --- */
.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--r-md);
  border-left: 4px solid transparent;
  font-size: .9375rem;
  line-height: 1.6;
}

.callout-info    { background: #eff6ff; border-color: var(--c-primary); color: #1e40af; }
.callout-warning { background: #fffbeb; border-color: var(--c-warning); color: #92400e; }
.callout-success { background: #f0fdf4; border-color: var(--c-trust); color: #065f46; }

/* --- Sources / references block --- */
.sources-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  font-size: .8125rem;
  color: #64748b;
  line-height: 1.6;
}

.sources-block a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Article meta (date, read time, category) --- */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  font-size: .8125rem;
  color: #6b7280;
  align-items: center;
}

/* --- Inline author card --- */
.author-inline {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.author-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: .875rem;
  flex-shrink: 0;
  overflow: hidden;
}

.author-name {
  font-size: .875rem;
  font-weight: 600;
  color: #111827;
}

.author-title {
  font-size: .75rem;
  color: #6b7280;
}

/* --- KBM table row highlights --- */
.kbm-table .tr-danger  { background: #fef2f2; }
.kbm-table .tr-success { background: #f0fdf4; }
.kbm-table .tr-neutral { background: #f9fafb; }

/* --- Pros / Cons comparison block --- */
.pros-cons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .pros-cons-grid { grid-template-columns: 1fr; }
}

.pros-block,
.cons-block {
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
}

.pros-block { background: #f0fdf4; border: 1px solid #a7f3d0; }
.cons-block { background: #fef2f2; border: 1px solid #fecaca; }

.pros-block .block-title { color: #065f46; font-weight: 600; font-size: .9375rem; }
.cons-block .block-title { color: #991b1b; font-weight: 600; font-size: .9375rem; }


/* ==========================================================================
   20. FOOTER
   ========================================================================== */

.footer-dark {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  color: #94a3b8;
}

.footer-link {
  font-size: .875rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color var(--t-fast);
  display: inline-block;
}

.footer-link:hover {
  color: white;
}

.footer-heading {
  font-size: .875rem;
  font-weight: 600;
  color: white;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* CBR / regulatory disclaimer (required for insurance sites in Russia) */
.footer-cbr-notice {
  font-size: .6875rem;
  color: #475569;
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  line-height: 1.7;
}

.footer-cbr-notice a {
  color: #64748b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-cbr-notice a:hover {
  color: #94a3b8;
}


/* ==========================================================================
   21. ANIMATIONS / KEYFRAMES
   ========================================================================== */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

@keyframes bounceIn {
  0%   { transform: scale(.9);  opacity: 0; }
  60%  { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); }
}

/* Animation utility classes */
.animate-fadeIn       { animation: fadeIn .2s ease forwards; }
.animate-fadeInScale  { animation: fadeInScale .2s ease forwards; }
.animate-slideInRight { animation: slideInRight .2s ease forwards; }
.animate-spin         { animation: spin .6s linear infinite; }
.animate-bounce-in    { animation: bounceIn .3s ease forwards; }

/* Skeleton loading placeholder */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% auto;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
  color: transparent;
  pointer-events: none;
}

/* Live indicator dot */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse-dot 2s ease-in-out infinite;
  display: inline-block;
  flex-shrink: 0;
}


/* ==========================================================================
   22. RESPONSIVE UTILITIES
   ========================================================================== */

/* Hide scrollbar but keep scroll functionality */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Horizontal drag-to-scroll strip (better than marquee) */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Sticky sidebar (LK / comparison page) */
.sticky-sidebar {
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

/* Full-bleed on mobile */
@media (max-width: 639px) {
  .mobile-full-bleed {
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
  }
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid #f3f4f6;
  margin: 0;
}

.divider-dark {
  border-top-color: #1e293b;
}

/* Aspect ratio utilities (for older browsers) */
.aspect-video  { aspect-ratio: 16 / 9; }
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-card   { aspect-ratio: 4 / 3; }

/* Text truncation helpers */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}


/* ==========================================================================
   23. PRINT STYLES
   ========================================================================== */

@media print {
  .header-blur,
  footer,
  .no-print,
  .modal-overlay,
  .btn-primary,
  .btn-trust,
  .alert-erid {
    display: none !important;
  }

  .card,
  .card-raised,
  .card-lift,
  .card-policy {
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: white;
  }

  .hero-dark {
    background: white;
    color: #000;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 9pt;
    color: #6b7280;
  }

  /* Avoid breaking cards across pages */
  .card,
  .card-policy,
  .faq-item {
    break-inside: avoid;
  }
}
