/* ============================================================
   URI™ — style.css
   Pure CSS — no framework, no build step
   ============================================================ */

:root {
  --primary:   #2D3A8C;
  --primary-d: #1e2a6e;
  --accent:    #FF7518;
  --success:   #16a34a;
  --warning:   #d97706;
  --danger:    #dc2626;
  --info:      #2563eb;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-400:  #9ca3af;
  --gray-600:  #4b5563;
  --gray-800:  #1f2937;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Inter', Arial, sans-serif; color: var(--gray-800); background: var(--gray-50); line-height: 1.6; }
h1,h2,h3,h4 { font-family: 'Nunito', Arial, sans-serif; font-weight: 700; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────────── */
.container  { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.main-wrap  { min-height: calc(100vh - 60px - 80px); }

/* ── Nav ────────────────────────────────────────────────────── */
.topnav {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: .7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.nav-brand {
  font-family: 'Nunito', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.01em;
}
.nav-links { display: flex; align-items: center; gap: 1.25rem; font-size: .9rem; flex-wrap: wrap; }
.nav-links a { color: var(--gray-600); font-weight: 500; }
.nav-links a:hover { color: var(--primary); text-decoration: none; }
.nav-user { color: var(--gray-600); font-size: .875rem; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--gray-600); }
.btn-nav-primary { background: var(--primary); color: #fff !important; padding: .4rem 1rem; border-radius: var(--radius); font-weight: 600; }
.btn-nav-danger  { color: var(--danger) !important; font-weight: 500; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all .15s;
  text-decoration: none; line-height: 1.4;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-d); }
.btn-success  { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger   { background: var(--danger);  color: #fff; border-color: var(--danger);  }
.btn-outline  { background: transparent; border-color: var(--gray-200); color: var(--gray-600); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-white    { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-white:hover { background: rgba(255,255,255,.3); }
.btn-white-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group  { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 500; color: var(--gray-600); margin-bottom: .3rem; }
.form-control {
  width: 100%; padding: .55rem .8rem;
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  font-size: .9rem; font-family: inherit;
  transition: border-color .15s; background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,58,140,.1); }
.form-hint { font-size: .75rem; color: var(--gray-400); margin-top: .25rem; }
.input-icon { position: relative; }
.input-icon .form-control { padding-right: 2.5rem; }
.icon-btn { position: absolute; right: .6rem; top: .55rem; background: none; border: none; cursor: pointer; color: var(--gray-400); }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ── Cards ──────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); margin-bottom: 1rem; }

/* ── Stats grid ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card  { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.stat-val   { font-size: 1.9rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: .75rem; color: var(--gray-400); margin-top: .3rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th { background: var(--gray-50); padding: .6rem .75rem; text-align: left; font-size: .72rem; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.data-table td { padding: .75rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }
.empty-cell { text-align: center; color: var(--gray-400); padding: 2.5rem !important; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 9px; border-radius: 20px; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }

/* ── Notification badge ─────────────────────────────────────── */
.notif-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); color: #fff;
  font-size: .65rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 10px;
  padding: 0 4px;
}

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-wrap  { display: flex; align-items: center; justify-content: center; min-height: 80vh; padding: 1.5rem; }
.auth-card  { background: #fff; border: 1px solid var(--gray-200); border-radius: 16px; padding: 2rem; max-width: 420px; width: 100%; box-shadow: var(--shadow); }
.auth-logo  { font-family: 'Nunito', sans-serif; font-size: 2rem; font-weight: 800; color: var(--primary); text-align: center; margin-bottom: .5rem; }
.auth-card h2  { font-size: 1.3rem; text-align: center; margin-bottom: .25rem; }
.auth-sub   { text-align: center; color: var(--gray-400); font-size: .875rem; margin-bottom: 1.5rem; }
.auth-foot  { text-align: center; margin-top: 1.25rem; font-size: .875rem; color: var(--gray-400); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { background: linear-gradient(135deg, var(--primary) 0%, #1a2570 100%); color: #fff; padding: 5rem 1rem; text-align: center; }
.hero-inner { max-width: 700px; margin: 0 auto; }
.hero-badge { display: inline-block; background: rgba(255,255,255,.15); color: #fff; font-size: .8rem; font-weight: 600; padding: .3rem 1rem; border-radius: 20px; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 1.25rem; }
.hero-title { font-size: 2.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.hero-sub   { font-size: 1.05rem; opacity: .85; max-width: 560px; margin: 0 auto 2rem; line-height: 1.7; }
.hero-btns  { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Features grid ──────────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.feature-card  { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow); }
.feature-icon  { font-size: 2rem; margin-bottom: .6rem; }
.feature-card h3 { font-size: 1rem; margin-bottom: .3rem; }
.feature-card p  { font-size: .875rem; color: var(--gray-600); }

/* ── Plans grid ─────────────────────────────────────────────── */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1rem; margin-bottom: 2rem; }
.plan-card  { background: #fff; border: 1px solid var(--gray-200); border-radius: 16px; padding: 1.5rem; position: relative; transition: box-shadow .15s; }
.plan-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.plan-popular { border: 2px solid var(--primary); transform: scale(1.02); box-shadow: 0 8px 32px rgba(45,58,140,.15); }
.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 14px; border-radius: 12px; white-space: nowrap; }
.plan-name  { font-weight: 700; font-size: 1rem; margin-bottom: .4rem; }
.plan-price { font-size: 2.2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.plan-dur   { font-size: .8rem; color: var(--gray-400); margin-bottom: 1.25rem; }
.plan-features { list-style: none; margin-bottom: 1.5rem; }
.plan-features li { font-size: .85rem; color: var(--gray-600); padding: .3rem 0; display: flex; gap: .5rem; }
.plan-features li .fa-check { color: var(--success); flex-shrink: 0; margin-top: .2rem; }

/* ── Dashboard hero bar ─────────────────────────────────────── */
.dashboard-hero { background: linear-gradient(135deg, var(--primary) 0%, #1a2570 100%); color: #fff; padding: 1.25rem 0; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--gray-400); }
.empty-state i { display: block; margin-bottom: .75rem; }
.empty-state p { margin-bottom: .75rem; }

/* ── Test engine ────────────────────────────────────────────── */
.test-wrap     { display: grid; grid-template-columns: 1fr 260px; height: 100vh; overflow: hidden; }
.test-q-panel  { padding: 1.5rem; overflow-y: auto; border-right: 1px solid var(--gray-200); }
.test-sidebar  { background: var(--gray-50); padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: .75rem; }
.test-topbar   { background: var(--primary); color: #fff; padding: .6rem 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.timer-box     { font-family: monospace; font-size: 1.2rem; font-weight: 700; background: rgba(255,255,255,.15); padding: .3rem .9rem; border-radius: 6px; }
.timer-warn    { background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1}50%{opacity:.6} }
.q-number  { font-size: .78rem; color: var(--gray-400); font-weight: 500; margin-bottom: .5rem; }
.q-text    { font-size: 1rem; line-height: 1.75; margin-bottom: 1.25rem; }
.options   { display: flex; flex-direction: column; gap: .6rem; list-style: none; }
.opt       { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem; border: 1px solid var(--gray-200); border-radius: var(--radius); cursor: pointer; transition: all .15s; }
.opt:hover { border-color: var(--primary); background: #f0f3ff; }
.opt.selected { border-color: var(--primary); background: #e8ecf8; }
.opt.correct  { border-color: var(--success); background: #dcfce7; }
.opt.wrong    { border-color: var(--danger);  background: #fee2e2; }
.opt-key   { width: 28px; height: 28px; border-radius: 50%; background: var(--gray-100); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; flex-shrink: 0; }
.q-nav     { display: flex; justify-content: space-between; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--gray-100); }
.palette   { display: grid; grid-template-columns: repeat(5,1fr); gap: 4px; }
.pal-btn   { aspect-ratio: 1; font-size: .75rem; font-weight: 600; border: 1px solid var(--gray-200); background: #fff; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pal-btn.answered { background: var(--success); color: #fff; border-color: var(--success); }
.pal-btn.current  { background: var(--primary); color: #fff; border-color: var(--primary); }
.pal-btn.flagged  { background: #fef3c7; border-color: #fde68a; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer { background: var(--gray-800); color: #fff; padding: 1.5rem 1rem; margin-top: 3rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .875rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: rgba(255,255,255,.7); }
.footer-links a:hover { color: #fff; text-decoration: none; }

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: #1f2937; color: #fff; padding: .7rem 1.1rem; border-radius: 8px; font-size: .875rem; font-weight: 500; max-width: 320px; opacity: 0; transform: translateY(8px); transition: all .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast-success { background: #166534; }
.toast-error   { background: #991b1b; }
.toast-info    { background: #1e3a8a; }

/* ── Pulse animation ─────────────────────────────────────────── */
.pulse { animation: pulse-anim 2s infinite; }
@keyframes pulse-anim { 0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,.4)}70%{box-shadow:0 0 0 8px rgba(220,38,38,0)} }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links  { display: none; position: absolute; top: 56px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--gray-200); flex-direction: column; padding: 1rem 1.5rem; gap: .75rem; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .hero-title { font-size: 1.8rem; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .test-wrap  { grid-template-columns: 1fr; }
  .test-sidebar { position: fixed; bottom: 0; left: 0; right: 0; height: 180px; border-top: 1px solid var(--gray-200); }
  .test-q-panel { height: calc(100vh - 56px - 180px); }
  .plans-grid { grid-template-columns: 1fr; }
  .plan-popular { transform: none; }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card  { padding: 1.5rem; }
  .hero       { padding: 3rem 1rem; }
}
