/* =========================================================================
   CertsNexus — Premium Blue & White Design System
   Brand palette and class names are unchanged; only the visual layer is
   elevated to a luxury, enterprise-grade SaaS appearance.
   ========================================================================= */
:root {
  /* ----- Brand palette (unchanged) ----- */
  --blue-50: #eef4ff;
  --blue-100: #dbe7ff;
  --blue-200: #b9d0ff;
  --blue-300: #8bb0ff;
  --blue-400: #5a8bff;
  --blue-500: #1e63ff;
  --blue-600: #1450e6;
  --blue-700: #0f3fb4;
  --blue-800: #102f80;
  --ink: #0c1733;
  --muted: #5b6b8c;
  --line: #e4eaf5;
  --bg: #f6f9ff;
  --white: #ffffff;
  --green: #1aa564;
  --green-bg: #e6f7ef;
  --red: #e23d4c;
  --red-bg: #fdeaec;
  --amber: #d9911a;
  --amber-bg: #fdf3e3;

  /* ----- Signature gradients ----- */
  --grad-brand: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  --grad-brand-soft: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  --grad-hero: radial-gradient(120% 120% at 0% 0%, var(--blue-600) 0%, var(--blue-700) 40%, #0a2f8f 100%);
  --grad-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));

  /* ----- Layered, brand-tinted shadows ----- */
  --shadow-xs: 0 1px 2px rgba(16, 47, 128, 0.06);
  --shadow-sm: 0 1px 2px rgba(16, 47, 128, 0.06), 0 2px 6px rgba(16, 47, 128, 0.07);
  --shadow-md: 0 6px 18px rgba(16, 47, 128, 0.1), 0 2px 6px rgba(16, 47, 128, 0.06);
  --shadow-lg: 0 18px 48px rgba(16, 47, 128, 0.16), 0 6px 16px rgba(16, 47, 128, 0.08);
  --shadow-xl: 0 32px 70px rgba(16, 47, 128, 0.22);
  --ring: 0 0 0 4px var(--blue-100);
  --ring-strong: 0 0 0 4px rgba(30, 99, 255, 0.35);

  /* ----- Glassmorphism ----- */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.6);

  /* ----- Radii ----- */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-full: 999px;

  /* ----- Motion ----- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.2, 0.8, 0.3, 1.1);
  --t-fast: 0.16s;
  --t-med: 0.28s;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }
html { scroll-behavior: smooth; }

/* Sticky footer: column layout keeps the footer pinned to the bottom on short pages */
#root { display: flex; flex-direction: column; min-height: 100vh; }
#root > main { flex: 1 0 auto; }
#root > .footer { flex-shrink: 0; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  /* Subtle premium backdrop: soft brand glows over the base canvas */
  background-color: var(--bg);
  background-image:
    radial-gradient(60% 50% at 100% 0%, rgba(91, 139, 255, 0.10), transparent 60%),
    radial-gradient(50% 45% at 0% 12%, rgba(30, 99, 255, 0.06), transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
}

::selection { background: var(--blue-200); color: var(--blue-800); }

a { color: var(--blue-600); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--blue-700); }

h1, h2, h3, h4 {
  line-height: 1.15;
  margin: 0 0 0.4em;
  color: var(--ink);
  letter-spacing: -0.025em;
  font-weight: 800;
}
h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 1.9rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--ink); }

/* Accessible keyboard focus everywhere */
:focus-visible {
  outline: none;
  box-shadow: var(--ring-strong);
  border-radius: var(--radius-xs);
}

/* Refined scrollbars (WebKit) */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb {
  background: var(--blue-200);
  border-radius: var(--radius-full);
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--blue-300); }

/* ===== Layout helpers ===== */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.page { padding: 36px 0 72px; animation: fadeUp 0.5s var(--ease) both; }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; gap: 22px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* ===== Buttons ===== */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; cursor: pointer; letter-spacing: -0.01em;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 11px 18px; white-space: nowrap; overflow: hidden;
  color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
/* moving sheen on hover */
.btn::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-130%); transition: transform 0.6s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.22); filter: brightness(1.04); }
.btn:hover::after { transform: translateX(130%); }
.btn:active { transform: translateY(0); filter: brightness(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-xs); filter: none; }
.btn:disabled::after { display: none; }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; border-radius: var(--radius); }
.btn-sm { padding: 8px 14px; font-size: 0.86rem; }
.btn-ghost { background: var(--white); color: var(--blue-700); border-color: var(--line); box-shadow: var(--shadow-xs); }
.btn-ghost::after { display: none; }
.btn-ghost:hover { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-200); }
.btn-white { background: #fff; color: var(--blue-700); box-shadow: var(--shadow-md); }
.btn-white:hover { background: #fff; filter: brightness(1); box-shadow: var(--shadow-lg); }
.btn-danger { background: linear-gradient(135deg, #ef5a67, var(--red)); }
.btn-danger:hover { background: linear-gradient(135deg, #d83e4b, #c8323f); }
.btn-success { background: linear-gradient(135deg, #2bc47d, var(--green)); }
.btn-block { width: 100%; }

/* ===== Cards ===== */
.card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: box-shadow var(--t-med) var(--ease), transform var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease);
}
.card-hover { cursor: pointer; }
.card-hover::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, var(--blue-300), transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity var(--t-med) var(--ease);
}
.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--blue-200);
}
.card-hover:hover::before { opacity: 1; }

/* Optional glass surface */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-color: var(--glass-border);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 11px; border-radius: var(--radius-full);
  background: var(--blue-50); color: var(--blue-700);
  border: 1px solid rgba(30, 99, 255, 0.12);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
a.badge:hover, .badge-green[href]:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.badge-green, .badge-free { background: var(--green-bg); color: var(--green); border-color: rgba(26, 165, 100, 0.16); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border-color: rgba(217, 145, 26, 0.18); }
.badge-red { background: var(--red-bg); color: var(--red); border-color: rgba(226, 61, 76, 0.16); }

/* ===== Forms ===== */
.field { margin-bottom: 18px; }
.label { display: block; font-weight: 650; font-size: 0.88rem; margin-bottom: 7px; color: var(--ink); letter-spacing: -0.01em; }
.input, .textarea, .select {
  width: 100%; font: inherit; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  box-shadow: var(--shadow-xs);
}
.input::placeholder, .textarea::placeholder { color: #9aa7c2; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--blue-200); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--blue-400);
  box-shadow: var(--ring);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6b8c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}

/* ===== Navbar ===== */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(228, 234, 245, 0.8);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.28rem; color: var(--ink); letter-spacing: -0.035em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--grad-brand);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(20, 80, 230, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform var(--t-med) var(--ease-spring);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.brand-mark span { transform: translateY(-1px); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative; padding: 8px 14px; border-radius: var(--radius-xs);
  font-weight: 600; color: var(--muted); font-size: 0.95rem;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-link::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  border-radius: 2px; background: var(--grad-brand);
  transform: scaleX(0); transform-origin: left; transition: transform var(--t-med) var(--ease);
}
.nav-link:hover { color: var(--blue-700); background: var(--blue-50); }
.nav-link.active { color: var(--blue-700); background: var(--blue-50); }
.nav-link.active::after { transform: scaleX(1); }

/* ===== User dropdown menu ===== */
.user-menu { position: relative; }
.user-trigger {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-full);
  padding: 5px 12px 5px 6px; box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.user-trigger:hover { border-color: var(--blue-200); background: var(--blue-50); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  background: var(--grad-brand); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.user-trigger .chev { color: var(--muted); transition: transform var(--t-fast) var(--ease); }
.user-trigger[aria-expanded='true'] .chev { transform: rotate(180deg); }

.menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  min-width: 230px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 7px; overflow: hidden;
  animation: menuPop 0.16s var(--ease) both; transform-origin: top right;
}
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head .nm { font-weight: 700; color: var(--ink); }
.menu-head .em { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius-xs); cursor: pointer;
  font: inherit; font-weight: 550; color: var(--ink); text-align: left;
  background: none; border: none; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.menu-item:hover { background: var(--blue-50); color: var(--blue-700); }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: var(--red-bg); color: var(--red); }
.menu-item .ic { width: 18px; text-align: center; opacity: 0.85; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
@keyframes menuPop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ===== Hero ===== */
.hero {
  background: var(--grad-hero);
  color: #fff; padding: 88px 0 100px; position: relative; overflow: hidden;
  isolation: isolate;
}
/* layered glows */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(40% 60% at 85% 10%, rgba(138, 176, 255, 0.45), transparent 60%),
    radial-gradient(40% 50% at 10% 100%, rgba(91, 139, 255, 0.35), transparent 60%);
}
.hero::after {
  content: ''; position: absolute; right: -120px; top: -120px; z-index: -1;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
  animation: floaty 9s var(--ease) infinite alternate;
}
.hero > .container { animation: fadeUp 0.6s var(--ease) both; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.1rem); max-width: 760px; font-weight: 900; }
.hero p { color: rgba(255, 255, 255, 0.92); font-size: clamp(1.02rem, 0.9rem + 0.6vw, 1.2rem); max-width: 580px; }
.hero .badge {
  background: rgba(255, 255, 255, 0.14); color: #fff;
  border-color: rgba(255, 255, 255, 0.25); backdrop-filter: blur(6px);
}
/* Ghost buttons sit on the dark hero — keep them transparent so white text reads */
.hero .btn-ghost { background: transparent; box-shadow: none; color: #fff; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.75); color: #fff; }

/* ===== Tables ===== */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 0.93rem; vertical-align: middle; }
/* Action buttons grouped inside a cell (keeps the <td> a real table cell, vertically centered) */
.table-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.table-actions .btn { white-space: nowrap; flex: 0 0 auto; }
/* Keep the actions column tight so its buttons stay on one line */
.table td:last-child { white-space: nowrap; }
.table th {
  color: var(--muted); font-weight: 700; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fbfdff, #f5f8ff); white-space: nowrap;
}
.table tbody tr { transition: background var(--t-fast) var(--ease); }
.table tbody tr:hover td { background: var(--blue-50); }
.table tbody tr:last-child td { border-bottom: none; }

/* Table card: rounded container that scrolls horizontally instead of clipping/overflowing */
.table-card { padding: 0; overflow: hidden; }
.table-card .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: inherit; }

/* ===== Admin split layout (form + table). Collapses on small screens; the
   minmax(0,…) lets the table column shrink so wide tables scroll, not overflow. ===== */
.admin-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: start; }
.admin-split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 920px) {
  .admin-split, .admin-split--even { grid-template-columns: 1fr; }
}

/* ===== Premium tile (vendor / course / feature cards) ===== */
.tile { display: flex; flex-direction: column; gap: 2px; height: 100%; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; min-height: 44px; }
.tile-mark {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px;
  background: var(--grad-brand); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
  box-shadow: 0 6px 14px rgba(20, 80, 230, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform var(--t-med) var(--ease-spring);
}
.card-hover:hover .tile-mark { transform: rotate(-5deg) scale(1.05); }
.tile-title { margin: 2px 0 0; font-size: 1.18rem; }
.tile-desc { margin: 6px 0 0; flex: 1 1 auto; }
.tile-cta {
  margin-top: 16px; color: var(--blue-600); font-weight: 650; font-size: 0.92rem;
  display: inline-flex; align-items: center; gap: 6px;
  transition: gap var(--t-med) var(--ease), color var(--t-fast) var(--ease);
}
.card-hover:hover .tile-cta { gap: 12px; color: var(--blue-700); }

/* ===== Icon chip — gradient rounded square for feature / action / stat icons ===== */
.icon-chip {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.45rem; line-height: 1;
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  color: var(--blue-600); box-shadow: inset 0 0 0 1px rgba(30, 99, 255, 0.1);
  transition: transform var(--t-med) var(--ease-spring);
}
.icon-chip.brand {
  background: var(--grad-brand); color: #fff;
  box-shadow: 0 6px 14px rgba(20, 80, 230, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.icon-chip.amber { background: linear-gradient(135deg, var(--amber-bg), #fbe6c2); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(217, 145, 26, 0.14); }
.icon-chip.green { background: linear-gradient(135deg, var(--green-bg), #c9f0dc); color: var(--green); box-shadow: inset 0 0 0 1px rgba(26, 165, 100, 0.14); }
.card-hover:hover .icon-chip { transform: translateY(-2px) scale(1.05); }

/* ===== Inline code + scrollable code sample ===== */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em; background: var(--blue-50); color: var(--blue-700);
  padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(30, 99, 255, 0.12);
}
.code-sample {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem; line-height: 1.55;
  white-space: pre; overflow-x: auto; -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
/* inline <code> sits inside the sample without its own pill styling */
.code-sample code { background: none; border: none; padding: 0; color: inherit; font-size: 1em; }

/* ===== Empty state ===== */
.empty { text-align: center; padding: 44px 24px; color: var(--muted); }
.empty .icon-chip { margin: 0 auto 16px; opacity: 0.9; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }

/* ===== Checkbox / radio accent + nicer file input ===== */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--blue-500); width: 17px; height: 17px; cursor: pointer;
}
input[type="file"] {
  width: 100%; font: inherit; color: var(--muted); cursor: pointer;
  border: 1px dashed var(--blue-200); border-radius: var(--radius-sm); padding: 14px;
  background: var(--blue-50); transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
input[type="file"]:hover { border-color: var(--blue-400); background: #fff; }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; cursor: pointer; margin-right: 12px;
  border: none; border-radius: var(--radius-xs); padding: 8px 14px;
  background: var(--grad-brand); color: #fff;
}

/* ===== Question / Exam UI ===== */
.option {
  display: flex; align-items: center; gap: 13px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 15px 17px; margin-bottom: 11px; cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  background: #fff; user-select: none;
}
.option:hover { border-color: var(--blue-300); background: var(--blue-50); transform: translateX(2px); }
.option.selected { border-color: var(--blue-500); background: var(--blue-50); box-shadow: var(--ring); }
.option.correct { border-color: var(--green); background: var(--green-bg); }
.option.incorrect { border-color: var(--red); background: var(--red-bg); }
.option-marker {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px;
  border: 1.5px solid var(--blue-200); display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem; color: var(--blue-700); background: #fff;
  transition: all var(--t-fast) var(--ease);
}
.option.selected .option-marker { background: var(--grad-brand); border-color: var(--blue-500); color: #fff; }
.option.correct .option-marker { background: var(--green); border-color: var(--green); color: #fff; }
.option.incorrect .option-marker { background: var(--red); border-color: var(--red); color: #fff; }

.explain-box {
  margin-top: 14px; padding: 15px 17px; border-radius: var(--radius-sm);
  background: var(--blue-50); border: 1px solid var(--blue-100); font-size: 0.95rem;
  border-left: 4px solid var(--blue-400);
  animation: fadeUp 0.3s var(--ease) both;
}
.explain-box.correct { background: var(--green-bg); border-color: #bfe9d3; border-left-color: var(--green); }
.explain-box.incorrect { background: var(--red-bg); border-color: #f6c9ce; border-left-color: var(--red); }

/* progress */
.progress { height: 9px; background: var(--blue-100); border-radius: var(--radius-full); overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
  transition: width 0.4s var(--ease); position: relative; overflow: hidden;
}
.progress > span::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 1.6s linear infinite;
}

/* paywall */
.paywall {
  margin-top: 20px; padding: 36px 28px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue-50), #fff 70%);
  border: 1.5px dashed var(--blue-300); text-align: center;
  box-shadow: var(--shadow-sm);
}
.lock-icon {
  font-size: 2.6rem; display: inline-block;
  animation: floaty 3.5s var(--ease) infinite alternate;
}

/* alerts / toast */
.alert {
  padding: 13px 16px 13px 17px; border-radius: var(--radius-sm); font-size: 0.92rem; margin-bottom: 14px;
  border: 1px solid; border-left-width: 4px; box-shadow: var(--shadow-xs);
  animation: fadeUp 0.25s var(--ease) both;
}
.alert-error { background: var(--red-bg); border-color: #f6c9ce; border-left-color: var(--red); color: #b02633; }
.alert-success { background: var(--green-bg); border-color: #bfe9d3; border-left-color: var(--green); color: #0f7a47; }
.alert-info { background: var(--blue-50); border-color: var(--blue-100); border-left-color: var(--blue-500); color: var(--blue-700); }

.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: rgba(12, 23, 51, 0.92); color: #fff; padding: 13px 18px;
  border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 0.92rem; font-weight: 550;
  backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.08);
  animation: toastIn 0.32s var(--ease-spring) both;
}
.toast.error { background: rgba(226, 61, 76, 0.95); }
.toast.success { background: rgba(26, 165, 100, 0.95); }

/* ===== Modal / confirm dialog ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 20px;
  background: rgba(8, 18, 44, 0.5); backdrop-filter: blur(6px);
  animation: fadein 0.18s ease;
}
.modal {
  width: 100%; max-width: 440px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); overflow: hidden;
  animation: modalpop 0.26s var(--ease-spring);
}
.modal-body { padding: 28px 28px 12px; }
.modal-icon {
  width: 54px; height: 54px; border-radius: 15px; margin-bottom: 18px;
  display: grid; place-items: center; font-size: 1.55rem;
  background: var(--blue-50); color: var(--blue-600);
  box-shadow: inset 0 0 0 1px rgba(30, 99, 255, 0.12);
}
.modal-icon.danger { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 1px rgba(226, 61, 76, 0.14); }
.modal-icon.success { background: var(--green-bg); color: var(--green); box-shadow: inset 0 0 0 1px rgba(26, 165, 100, 0.14); }
.modal h3 { margin: 0 0 8px; font-size: 1.22rem; }
.modal-body p { color: var(--muted); margin: 0; font-size: 0.95rem; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 22px 28px 26px; }

/* footer */
.footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 32px 0; margin-top: 48px; color: var(--muted); font-size: 0.9rem;
}

/* utility: no-select for exam security */
.no-select { -webkit-user-select: none; -moz-user-select: none; user-select: none; }

/* spinner */
.spinner {
  width: 38px; height: 38px;
  border: 3px solid var(--blue-100); border-top-color: var(--blue-500);
  border-radius: 50%; animation: spin 0.7s linear infinite; margin: 48px auto;
}

/* skeleton loaders (additive utility for premium loading states) */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--blue-50); border-radius: var(--radius-sm); min-height: 16px;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.4s infinite;
}

.stat { text-align: center; }
.stat .num {
  font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .lbl { color: var(--muted); font-size: 0.85rem; font-weight: 550; }

/* ===== Keyframes ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastIn { from { transform: translateY(16px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes modalpop { from { transform: translateY(12px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes floaty { from { transform: translateY(0); } to { transform: translateY(-14px); } }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .hero { padding: 60px 0 68px; }
  .hero h1 { font-size: 2.1rem; }
  .hero p { font-size: 1.02rem; }
  .nav-links .hide-sm { display: none; }
  .nav-links { gap: 2px; }
  .row-between { flex-direction: column; align-items: stretch; }
  .page { padding: 24px 0 56px; }
  .card { padding: 20px; }
  .grid { gap: 16px; }
  /* let wide tables scroll horizontally instead of breaking layout */
  .table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}

/* Exam mode: block screenshots/long-press image save hints on mobile */
.exam-secure img { -webkit-touch-callout: none; pointer-events: none; }

/* Auth pages: premium brand header on the card */
.auth-brand {
  width: 48px; height: 48px; border-radius: 14px; margin: 0 0 18px;
  background: var(--grad-brand); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em;
  box-shadow: 0 8px 18px rgba(20, 80, 230, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.card.mt-4 { animation: fadeUp 0.45s var(--ease) both; }

/* "or" divider used on the auth (login / register) cards */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--muted); font-size: 0.82rem; font-weight: 550;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.google-btn-wrap { display: flex; justify-content: center; min-height: 44px; }
.recaptcha-wrap { display: flex; justify-content: center; }

/* ===== Floating WhatsApp support button (bottom-left) ===== */
.wa-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 900;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45), 0 2px 6px rgba(16, 47, 128, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.wa-fab:hover {
  background: #1ebe5b;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.55), 0 4px 10px rgba(16, 47, 128, 0.2);
}
.wa-fab:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.4);
  outline-offset: 2px;
}
.wa-fab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  animation: wa-pulse 2.4s infinite;
}
@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
@media (max-width: 600px) {
  .wa-fab { width: 50px; height: 50px; left: 14px; bottom: 14px; }
}

/* ===== Reduced motion: respect user preference ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
