/* ==========================================================================
   Violet Glass UI — dark glassmorphism theme
   1 Tokens · 2 Base · 3 Layout · 4 Glass panel · 5 Header · 6 Buttons ·
   7 Hero · 8 Features · 9 Pricing · 10 Forms · 11 Tables · 12 Badges ·
   13 Stats · 14 Tabs · 15 Alerts · 16 Footer · 17 Extras (optional) ·
   18 Responsive · 19 Accessibility & motion
   All original class names and CSS variables are preserved.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Palette: original tokens, unchanged */
  --bg-dark: #0b0813;
  --bg-card: rgba(18, 13, 29, 0.75);
  --bg-card-hover: rgba(28, 20, 46, 0.85);
  --border-subtle: rgba(139, 92, 246, 0.18);
  --border-focus: rgba(168, 85, 247, 0.55);
  --primary: #8b5cf6;
  --primary-hover: #a855f7;
  --primary-glow: rgba(139, 92, 246, 0.4);
  --accent: #c084fc;
  --accent-pink: #d946ef;
  --text-main: #f3f0fa;
  --text-muted: #948da7;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';

  /* Added: text tones */
  --primary-deep: #7c3aed;
  --text-soft: #cbd5e1;
  --success-soft: #34d399;
  --warning-soft: #fbbf24;
  --danger-soft: #fca5a5;
  --danger-strong: #f87171;
  --info-soft: #d8b4fe;
  --neutral-soft: #94a3b8;

  /* Added: RGB channels, used as rgb(var(--primary-rgb) / 0.2) */
  --primary-rgb: 139 92 246;
  --primary-hover-rgb: 168 85 247;
  --pink-rgb: 217 70 239;
  --success-rgb: 16 185 129;
  --warning-rgb: 245 158 11;
  --danger-rgb: 239 68 68;
  --neutral-rgb: 148 163 184;
  --surface-rgb: 15 11 24;

  /* Added: shape, depth, motion, type */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 0.25s;
  --gutter: clamp(16px, 3.5vw, 24px);
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* 2. Base ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-dark);
  color-scheme: dark;
  accent-color: var(--primary);
  scroll-padding-top: 24px;
  scrollbar-color: rgb(var(--primary-rgb) / 0.45) transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, pre, hr { margin: 0; }
ul, ol { margin: 0; padding: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
button, input, select, textarea { margin: 0; font: inherit; letter-spacing: inherit; }
img, video { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; } /* classes with display: flex must not beat the hidden attribute */

body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text-main);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Glow backdrop. A fixed pseudo-element replaces background-attachment: fixed,
   which is janky or ignored on mobile browsers. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 10% 20%, rgb(var(--primary-rgb) / 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgb(var(--pink-rgb) / 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgb(76 29 149 / 0.05) 0%, transparent 60%);
}

a:not([class]) {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur) var(--ease);
}
a:not([class]):hover { color: #fff; }

::selection { background: rgb(var(--primary-rgb) / 0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

* { scrollbar-width: thin; }
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    background: rgb(var(--primary-rgb) / 0.4);
    background-clip: content-box;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 3. Layout ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding: var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* 4. Glass panel ----------------------------------------------------------- */
.glass-panel {
  background: var(--bg-card);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.glass-panel:hover { border-color: var(--border-focus); }
.feature-card:hover,
.price-card:hover { background-color: var(--bg-card-hover); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-panel { background: rgb(18 13 29 / 0.96); }
}

/* 5. Header & navigation --------------------------------------------------- */
header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 20px 0 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgb(var(--primary-rgb) / 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--radius-md);
  color: #fff;
  text-decoration: none;
}

.brand-logo-svg {
  flex: none;
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

/* Gradient text (shared). Bottom padding stops descenders (у, р, g, y) from being clipped. */
.brand-text,
.hero-title {
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand-text {
  padding-bottom: 0.1em;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  background-image: linear-gradient(135deg, #fff 40%, var(--accent) 100%);
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-text,
  .hero-title { background: none; -webkit-text-fill-color: currentColor; color: #fff; }
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.nav-link {
  padding-block: 6px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.nav-link:hover,
.nav-link.active,
.nav-link[aria-current="page"] { color: #fff; }

/* 6. Buttons --------------------------------------------------------------- */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn-primary {
  background: linear-gradient(135deg, rgb(var(--primary-rgb) / 0.2), rgb(var(--primary-hover-rgb) / 0.35));
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  color: #fff;
}

/* Gradients can't be transitioned, so the hover brightening is a fading overlay */
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgb(var(--primary-rgb) / 0.15), rgb(var(--primary-hover-rgb) / 0.2));
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.btn-primary:hover {
  box-shadow: 0 0 25px var(--primary-glow);
  transform: translateY(-1px);
}
.btn-primary:hover::before { opacity: 1; }

.btn-glow {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-hover));
  box-shadow: 0 4px 20px rgb(var(--primary-rgb) / 0.5);
  color: #fff;
}

.btn-glow:hover {
  box-shadow: 0 6px 30px rgb(var(--primary-hover-rgb) / 0.7);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgb(255 255 255 / 0.05);
  border-color: rgb(255 255 255 / 0.1);
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: rgb(255 255 255 / 0.1);
  color: #fff;
}

.btn-danger {
  background: rgb(var(--danger-rgb) / 0.15);
  border-color: rgb(var(--danger-rgb) / 0.3);
  color: var(--danger-soft);
}

.btn-danger:hover {
  background: rgb(var(--danger-rgb) / 0.3);
  color: #fff;
}

.btn-sm { padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

.btn:active { transform: translateY(0) scale(0.98); }

.btn:disabled,
.btn[aria-disabled="true"],
.btn.is-disabled {
  opacity: 0.5;
  box-shadow: none;
  pointer-events: none;
}

.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 1.1em;
  height: 1.1em;
  border: 2px solid rgb(255 255 255 / 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* 7. Hero ------------------------------------------------------------------ */
.hero {
  padding: clamp(28px, 6vw, 40px) 0 clamp(40px, 8vw, 60px);
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 6px 16px;
  border: 1px solid rgb(var(--success-rgb) / 0.3);
  border-radius: var(--radius-pill);
  background: rgb(var(--success-rgb) / 0.1);
  color: var(--success-soft);
  font-size: 13px;
  font-weight: 500;
}

/* The pulse animates transform/opacity on a pseudo-element: no repaints, unlike animating box-shadow */
.pulse-dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% { opacity: 0.7; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(3); }
}

.hero-title {
  margin-bottom: 12px;
  padding-bottom: 0.12em;
  font-size: clamp(30px, 6vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  background-image: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
}

.hero-desc {
  max-width: 680px;
  margin: 0 auto 36px;
  color: var(--text-muted);
  font-size: clamp(16px, 2.2vw, 18px);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

/* 8. Features -------------------------------------------------------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 24px;
  margin: 40px 0;
}

.feature-card { padding: 28px; }

.feature-icon {
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  min-height: 56px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgb(var(--primary-rgb) / 0.2);
  border-radius: 12px;
  background: rgb(var(--primary-rgb) / 0.1);
  font-size: 32px;
  line-height: 1;
  vertical-align: top;
}

.feature-title {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.feature-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* 9. Pricing --------------------------------------------------------------- */
.pricing-section { margin: 60px 0; }

.section-title {
  margin-bottom: 12px;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.section-desc {
  max-width: 60ch;
  margin: 0 auto 40px;
  color: var(--text-muted);
  text-align: center;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 20px;
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px;
  text-align: center;
}

.price-card.popular {
  border-color: var(--primary);
  background: rgba(24, 17, 39, 0.9);
  box-shadow: 0 0 30px rgb(var(--primary-rgb) / 0.25);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-hover));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
}

.plan-name {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 600;
}

.plan-price {
  margin-bottom: 6px;
  color: #fff;
  font-size: clamp(32px, 5vw, 38px);
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.plan-period {
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.plan-features {
  flex-grow: 1;
  margin-bottom: 30px;
  list-style: none;
  text-align: left;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.45;
}

.plan-features li span.check {
  flex: none;
  color: var(--success);
  font-weight: bold;
}

/* 10. Forms ---------------------------------------------------------------- */
.form-group { margin-bottom: 20px; text-align: left; }

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.form-hint,
.form-error { margin-top: 6px; font-size: 12px; line-height: 1.4; }
.form-hint { color: var(--text-muted); }
.form-error { color: var(--danger-soft); }

.input-wrapper { position: relative; display: flex; align-items: center; }

.input-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
  transition: color var(--dur) var(--ease);
}
.input-wrapper:focus-within .input-icon { color: var(--accent); }

.form-control {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid rgb(var(--primary-rgb) / 0.25);
  border-radius: var(--radius-md);
  background: rgb(var(--surface-rgb) / 0.8);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.form-control.no-icon { padding-left: 16px; }
.form-control::placeholder { color: var(--text-muted); opacity: 0.85; }
.form-control:hover:where(:not(:disabled)) { border-color: rgb(var(--primary-rgb) / 0.4); }

.form-control:focus {
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / 0.15), 0 0 15px rgb(var(--primary-rgb) / 0.3);
  outline: 2px solid transparent; /* stays visible in forced-colors mode */
  outline-offset: 2px;
}

.form-control.is-invalid,
.form-control[aria-invalid="true"] { border-color: rgb(var(--danger-rgb) / 0.6); }

.form-control.is-invalid:focus,
.form-control[aria-invalid="true"]:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgb(var(--danger-rgb) / 0.15), 0 0 15px rgb(var(--danger-rgb) / 0.3);
}

.form-control:disabled { opacity: 0.55; cursor: not-allowed; }

textarea.form-control { min-height: 110px; resize: vertical; }

select.form-control {
  padding-right: 40px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23948da7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}
select.form-control option { background: #120d1d; color: var(--text-main); }

/* Chrome/Safari autofill would otherwise paint a light background */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  box-shadow: 0 0 0 1000px rgb(var(--surface-rgb)) inset;
  transition: background-color 9999s ease-out;
}
.form-control:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px rgb(var(--surface-rgb)) inset, 0 0 0 3px rgb(var(--primary-rgb) / 0.15);
}

/* 11. Tables --------------------------------------------------------------- */
.table-responsive { width: 100%; overflow-x: auto; }

table {
  width: 100%;
  border-collapse: separate; /* keeps borders attached to a sticky header */
  border-spacing: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

th {
  padding: 14px 16px;
  border-bottom: 1px solid rgb(var(--primary-rgb) / 0.15);
  background: rgb(255 255 255 / 0.03);
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid rgb(255 255 255 / 0.05);
  color: var(--text-soft);
  line-height: 1.4;
  vertical-align: middle;
  transition: background-color 0.15s var(--ease);
}

tbody tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgb(var(--primary-rgb) / 0.04); }
th.num,
td.num { text-align: right; }

/* Scrollable table with sticky header: <div class="table-responsive is-scroll"> */
.table-responsive.is-scroll { max-height: 520px; overflow-y: auto; }
.table-responsive.is-scroll th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(rgb(255 255 255 / 0.03), rgb(255 255 255 / 0.03)), #120d1d;
}

/* 12. Badges --------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-active { background: rgb(var(--success-rgb) / 0.15); border-color: rgb(var(--success-rgb) / 0.3); color: var(--success-soft); }
.badge-unused { background: rgb(var(--neutral-rgb) / 0.15); border-color: rgb(var(--neutral-rgb) / 0.3); color: var(--neutral-soft); }
.badge-expired { background: rgb(var(--warning-rgb) / 0.15); border-color: rgb(var(--warning-rgb) / 0.3); color: var(--warning-soft); }
.badge-banned { background: rgb(var(--danger-rgb) / 0.15); border-color: rgb(var(--danger-rgb) / 0.3); color: var(--danger-strong); }
.badge-info { background: rgb(var(--primary-rgb) / 0.15); border-color: rgb(var(--primary-rgb) / 0.3); color: var(--info-soft); }

/* 13. Stats ---------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card { padding: 20px; }

.stat-label {
  color: var(--text-muted);
  font-size: 13px;
}

.stat-value {
  margin-top: 4px;
  color: #fff;
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* 14. Tabs ----------------------------------------------------------------- */
/* The 1px baseline is an inset shadow so the 2px active underline sits exactly on top of it */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  box-shadow: inset 0 -1px 0 rgb(var(--primary-rgb) / 0.15);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 20px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.tab-btn:hover { color: #fff; }
.tab-btn:focus-visible { outline-offset: -2px; } /* the scroll container would clip an outer ring */

.tab-btn.active,
.tab-btn[aria-selected="true"] {
  color: #fff;
  border-bottom-color: var(--primary-hover);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fade-in 0.25s var(--ease); }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
}

/* 15. Alerts --------------------------------------------------------------- */
.alert {
  margin-bottom: 20px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
}

.alert-success { background: rgb(var(--success-rgb) / 0.15); border-color: rgb(var(--success-rgb) / 0.3); color: #6ee7b7; }
.alert-error { background: rgb(var(--danger-rgb) / 0.15); border-color: rgb(var(--danger-rgb) / 0.3); color: var(--danger-soft); }
.alert-warning { background: rgb(var(--warning-rgb) / 0.15); border-color: rgb(var(--warning-rgb) / 0.3); color: var(--warning-soft); }
.alert-info { background: rgb(var(--primary-rgb) / 0.15); border-color: rgb(var(--primary-rgb) / 0.3); color: var(--info-soft); }

/* 16. Footer --------------------------------------------------------------- */
footer {
  margin-top: 60px;
  padding: 30px 0;
  padding-bottom: max(30px, env(safe-area-inset-bottom));
  border-top: 1px solid rgb(var(--primary-rgb) / 0.1);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* 17. Extras (optional: new components, safe to delete) -------------------- */
code,
.mono { font-family: var(--font-mono); }

code {
  padding: 0.15em 0.45em;
  border: 1px solid rgb(var(--primary-rgb) / 0.2);
  border-radius: 6px;
  background: rgb(var(--primary-rgb) / 0.12);
  color: var(--accent);
  font-size: 0.9em;
}

/* License key with a copy button: <div class="key-box"><code class="key">…</code><button class="btn btn-sm btn-secondary">…</button></div> */
.key-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px dashed rgb(var(--primary-rgb) / 0.4);
  border-radius: var(--radius-md);
  background: rgb(var(--surface-rgb) / 0.8);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.key-box .key {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: anywhere;
  user-select: all; /* one click selects the whole key */
}

.empty-state { padding: 48px 24px; color: var(--text-muted); text-align: center; }

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

.spinner {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  border: 2px solid rgb(var(--primary-rgb) / 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -0.2em;
  animation: spin 0.7s linear infinite;
}

/* Modal: <div class="modal-backdrop is-open"><div class="modal glass-panel">…</div></div>
   Toggle .is-open on the backdrop and .modal-open on <body> (locks page scroll). */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(6 4 12 / 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }

.modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 28px;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
  transform: translateY(12px) scale(0.98);
  transition: transform var(--dur) var(--ease);
}
.modal-backdrop.is-open .modal { transform: none; }

.modal-title { margin-bottom: 8px; font-size: 20px; font-weight: 700; line-height: 1.3; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 24px; }
body.modal-open { overflow: hidden; }

/* Toasts: <div class="toast-stack"><div class="toast toast-success" role="status">…</div></div> */
.toast-stack {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1100;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgb(var(--surface-rgb) / 0.92);
  box-shadow: var(--shadow-pop);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 14px;
  line-height: 1.45;
  pointer-events: auto;
  animation: toast-in 0.3s var(--ease);
}
.toast-success { border-color: rgb(var(--success-rgb) / 0.4); }
.toast-error { border-color: rgb(var(--danger-rgb) / 0.4); }
.toast-warning { border-color: rgb(var(--warning-rgb) / 0.4); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
}

/* 18. Responsive ----------------------------------------------------------- */
@media (max-width: 640px) {
  header { padding-bottom: 24px; margin-bottom: 24px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .features-grid { gap: 16px; margin: 32px 0; }
  .feature-card,
  .price-card { padding: 24px; }
  .pricing-section { margin: 44px 0; }
  .section-desc { margin-bottom: 28px; }
  th, td { padding: 12px; }
  footer { margin-top: 44px; }
  .modal { padding: 22px; }
}

/* iOS Safari zooms the page when an input's font-size is below 16px */
@media (pointer: coarse) {
  .form-control { font-size: 16px; }
}

/* 19. Accessibility & motion ----------------------------------------------- */
.skip-link {
  position: absolute;
  top: -64px;
  left: 16px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--bg-dark);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 16px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* A frozen loader looks broken, so spinners keep turning, just slower */
  .spinner,
  .btn.is-loading::after {
    animation-duration: 1.6s !important;
    animation-iteration-count: infinite !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border-subtle: rgba(168, 85, 247, 0.5);
    --text-muted: #b9b3c9;
  }
}

@media (forced-colors: active) {
  .brand-text,
  .hero-title { background: none; -webkit-text-fill-color: currentColor; color: CanvasText; }
  .pulse-dot { forced-color-adjust: none; }
}