.root-reset { box-sizing: border-box; }
:root {
  --bg: linear-gradient(135deg, #eef2ff, #fdf2f8);
  --card: rgba(255,255,255,0.85);
  --accent: #4f46e5;
  --accent-2: #14b8a6;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 18px 50px rgba(15,23,42,0.12);
}

* { box-sizing: border-box; }
img, iframe { max-width: 100%; height: auto; display: block; }
body.glass-bg {
  background: var(--bg);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  margin: 0;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
.glass-bg::before,
.glass-bg::after {
  content:'';
  position: fixed;
  inset:-140px;
  pointer-events:none;
  z-index:-1;
  background: radial-gradient(220px at 20% 20%, rgba(79,70,229,0.12), transparent),
              radial-gradient(240px at 80% 30%, rgba(20,184,166,0.12), transparent);
}
.glass-bg::after {
  inset:-160px;
  background: radial-gradient(200px at 60% 70%, rgba(79,70,229,0.08), transparent),
              radial-gradient(260px at 10% 80%, rgba(20,184,166,0.08), transparent);
}
.muted { color: var(--muted); font-size: 13px; }
.container { max-width: 1180px; width: 100%; margin: 0 auto; padding: clamp(12px, 3vw, 18px); }
.card {
  background: var(--card);
  backdrop-filter: blur(18px);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border: 1px solid rgba(229,231,235,0.8);
  width: 100%;
  min-width: 0;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 20px 56px rgba(0,0,0,0.14); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8ba5ff);
  color: white;
  border: none;
  padding: 11px 16px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(79,70,229,0.2);
}
.btn-primary:hover { opacity: 0.95; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 9px 13px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); }
button, input, select, textarea { font-family: inherit; }
.flex { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; width: 100%; }
.question { margin-bottom: 16px; }
.option { display: block; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 10px; margin: 6px 0; background: rgba(255,255,255,0.85); }
.row { display: flex; align-items: center; justify-content: space-between; margin: 6px 0; gap: 10px; flex-wrap: wrap; }
.row > * { min-width: 0; }
.hero { padding: 26px; background: linear-gradient(135deg, rgba(79,70,229,0.12), rgba(20,184,166,0.12)); border:1px solid rgba(79,70,229,0.16); }
.mt-2 { margin-top: 8px; }
.hero h1 { margin:0 0 6px 0; font-size: clamp(22px, 3vw, 28px); }
.hero p { margin: 0 0 12px 0; color: var(--muted); }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; flex-wrap:wrap; }
.section-head h3 { margin:0; }
.strong { font-weight:700; color: var(--text); }
.card h2, .card h3 { color: var(--text); }
.link { color: var(--accent); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.tag { display:inline-block; padding:4px 10px; border-radius:999px; background: rgba(79,70,229,0.12); color: var(--accent); font-weight:600; font-size:12px; }
.tag.accent { background: rgba(20,184,166,0.12); color: #0f766e; }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { border:1px solid var(--border); padding:10px 12px; text-align:left; word-break: break-word; }
.table th { background: rgba(124,144,255,0.08); }
.table-compact th, .table-compact td { padding:8px 10px; font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.profile-wrap { display:grid; grid-template-columns: 280px 1fr; gap:16px; align-items:start; }
.profile-info { display:flex; align-items:center; gap:12px; padding:12px; border:1px solid var(--border); border-radius:14px; background: rgba(255,255,255,0.9); box-shadow: 0 10px 28px rgba(0,0,0,0.06); }
.profile-avatar { width:64px; height:64px; border-radius:50%; overflow:hidden; border:1px solid var(--border); background: rgba(0,0,0,0.05); display:flex; align-items:center; justify-content:center; }
.profile-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-avatar .initial { font-weight:700; color:var(--text); font-size:20px; }
.profile-name { font-weight:700; font-size:18px; color:var(--text); }
.profile-form { display:flex; flex-direction:column; gap:10px; }
.embed-frame { width: 100%; border: 0; border-radius: 16px; min-height: 260px; aspect-ratio: 16 / 9; box-shadow: 0 12px 32px rgba(0,0,0,0.08); }
.profile-form input,
.profile-form textarea,
.profile-form select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: rgba(255,255,255,0.96);
}
.stacked-form { display:flex; flex-direction: column; }
.form-field { display:flex; flex-direction:column; gap:6px; margin-bottom: 10px; }
.form-field label { font-size: 14px; font-weight: 600; color: var(--text); }
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: rgba(255,255,255,0.96);
}
.form-field textarea { min-height: 90px; resize: vertical; }
.quick-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 10px; margin: 12px 0; }
.stat-pill { border:1px solid var(--border); border-radius:14px; padding:10px 12px; background: rgba(255,255,255,0.85); }
.stat-value { font-weight:800; font-size: 18px; color: var(--text); }
.cta-row { display:flex; gap:10px; flex-wrap:wrap; }
.cta-row.subtle { margin-top:8px; }
.status-badge { padding:6px 10px; border-radius:999px; font-weight:700; font-size:12px; text-transform:capitalize; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.order-row { border-bottom:1px solid var(--border); padding-bottom:6px; }
.order-row:last-child { border-bottom:none; padding-bottom:0; }

/* Auth */
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); background: var(--card); backdrop-filter: blur(18px); border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.12); max-width: 960px; width: 100%; }
.auth-illustration { background: linear-gradient(135deg, #c7d2fe, #a5f3fc); min-height: 280px; }
.auth-form { padding: 32px; }
.auth-form h1 { margin: 0 0 8px 0; }
.auth-form p { margin: 0 0 16px 0; color: #4b5563; }
.auth-form form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input { padding: 12px; border-radius: 12px; border: 1px solid #e5e7eb; background: rgba(255,255,255,0.92); width: 100%; }
.auth-form label { font-size: 13px; color: #4b5563; }
.password-field { display:flex; align-items:center; gap:6px; background: rgba(255,255,255,0.9); border:1px solid #e5e7eb; border-radius:12px; padding:0 8px; }
.password-field input { border:none; flex:1; padding:10px 8px; background: transparent; }
.password-field input:focus { outline:none; box-shadow:none; }
.eye-btn { border:none; background: transparent; cursor:pointer; font-size:14px; padding:6px 8px; color:#4b5563; }
.btn-primary.full { width: 100%; text-align: center; }
.alert { background: rgba(255, 99, 99, 0.15); border: 1px solid rgba(255,99,99,0.3); padding: 10px 12px; border-radius: 12px; color: #b91c1c; font-size: 14px; }
.alert.success { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.4); color:#166534; }

/* Navbar */
.nav-shell { position:relative; display:flex; justify-content:space-between; align-items:center; padding:12px 14px; gap:12px; flex-wrap:wrap; border-radius:18px; background: rgba(255,255,255,0.92); border:1px solid rgba(229,231,235,0.9); box-shadow: 0 12px 36px rgba(0,0,0,0.08); margin-bottom:14px; overflow:visible; width: 100%; }
.nav-left .logo { font-weight:800; color:var(--text); text-decoration:none; font-size:20px; }
.nav-links { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.nav-links a { color:var(--text); text-decoration:none; padding:9px 12px; border-radius:12px; font-weight:600; }
.nav-links a:hover { background: rgba(124,144,255,0.12); box-shadow: inset 0 0 0 1px rgba(124,144,255,0.2); }
.nav-action { display:flex; gap:8px; align-items:center; position: relative; }
.nav-toggle { display:none; border:1px solid var(--border); background:white; border-radius:10px; padding:8px 10px; cursor:pointer; }
.mobile-nav-extra { display:none; }
.avatar-wrap { width:38px; height:38px; border-radius:50%; overflow:hidden; border:1px solid var(--border); display:flex; align-items:center; justify-content:center; background: rgba(0,0,0,0.05); cursor:pointer; }
.avatar-wrap img { width:100%; height:100%; object-fit: cover; }
.avatar-wrap span { font-weight:700; color:var(--text); }
.avatar-menu { position:absolute; right:0; top:calc(100% + 8px); background: rgba(255,255,255,0.95); border:1px solid var(--border); border-radius:12px; box-shadow: 0 18px 40px rgba(0,0,0,0.14); padding:10px; display:none; flex-direction:column; min-width:150px; z-index: 11; }
.avatar-menu a { padding:8px 10px; text-decoration:none; color:var(--text); border-radius:10px; }
.avatar-menu a:hover { background: rgba(124,144,255,0.12); }
.bottom-nav { display:none; position:fixed; bottom:0; left:0; right:0; background: rgba(255,255,255,0.95); border-top:1px solid var(--border); box-shadow: 0 -10px 30px rgba(0,0,0,0.08); padding:10px 12px; z-index: 20; }
.bottom-nav .nav-grid { display:grid; grid-template-columns: repeat(4,1fr); gap:8px; }
.bottom-nav a { text-align:center; text-decoration:none; color: var(--text); font-weight:600; padding:8px 6px; border-radius:12px; }
.bottom-nav a.active { background: rgba(79,70,229,0.12); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(79,70,229,0.2); }
.scroll-top { position:fixed; right:14px; bottom:90px; padding:10px 12px; border-radius:12px; border:1px solid var(--border); background:white; box-shadow:0 10px 24px rgba(0,0,0,0.12); cursor:pointer; display:none; z-index:21; }
.scroll-top.show { display:flex; }

/* Tryout */
.subtest-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.subtest-tabs button { border:1px solid #d1d5db; background: rgba(255,255,255,0.8); border-radius:12px; padding:8px 12px; cursor:pointer; }
.subtest-tabs button.active { background: linear-gradient(135deg,#7c90ff,#a8c0ff); color:white; border:none; }
.question { background: rgba(255,255,255,0.9); padding:12px; border-radius:14px; border:1px solid #e5e7eb; }
.question + .question { margin-top:10px; }
.q-number { font-weight:700; margin-bottom:6px; color:#4b5563; }
.q-stem { margin-bottom:8px; }
.exam-layout { display:flex; flex-direction:column; gap:12px; }
.exam-body { display:grid; grid-template-columns: 260px 1fr; gap:12px; }
.exam-nav { background: rgba(255,255,255,0.85); border:1px solid #e5e7eb; border-radius:14px; padding:12px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.nav-title { font-weight:700; margin-bottom:8px; }
.nav-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(44px,1fr)); gap:6px; }
.nav-btn { border:1px solid #e5e7eb; background: #fff; border-radius:10px; padding:8px 0; cursor:pointer; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; font-weight:600; }
.nav-btn.answered { background: #dcfce7; border-color: #16a34a; color:#166534; }
.nav-btn.doubt { background: #fef3c7; border-color: #f59e0b; color:#92400e; }
.nav-btn.unanswered { background: #e5e7eb; border-color: #cbd5e1; color:#6b7280; }
.nav-btn:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.option:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,70,229,0.12); }
.pill.success { background: #dcfce7; color: #166534; }
.tracker-hero { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.tracker-hero h1 { margin:0 0 6px 0; }
.tracker-lock { background: rgba(255,255,255,0.9); border:1px dashed var(--border); padding:12px; border-radius:14px; text-align:right; display:flex; flex-direction:column; gap:8px; min-width:220px; }
.badge-lock { display:inline-block; padding:6px 10px; border-radius:999px; background:#fef2f2; color:#b91c1c; font-weight:700; font-size:12px; }
.tracker-pill { display:inline-block; padding:8px 12px; border-radius:12px; background: rgba(20,184,166,0.12); color: var(--text); font-weight:600; }
.tracker-pill.warning { background: rgba(234,179,8,0.16); color:#92400e; }
.tracker-grid { display:grid; grid-template-columns: 1.6fr 1fr; gap:14px; align-items:start; }
.tracker-pane { background: rgba(255,255,255,0.78); border:1px solid rgba(229,231,235,0.85); border-radius:14px; padding:12px; box-shadow: 0 12px 30px rgba(0,0,0,0.05); }
.resource-table th, .resource-table td { font-size:14px; }
.resource-table td a.link { font-weight:700; }
.note-box { margin-top:10px; padding:10px 12px; border-radius:12px; background: rgba(79,70,229,0.08); border:1px dashed rgba(79,70,229,0.2); }
.locked-card { border:1px dashed var(--border); background: linear-gradient(135deg, rgba(124,144,255,0.08), rgba(20,184,166,0.08)); }
.features-grid { grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap:10px; }
.feature-pill { padding:12px; border-radius:12px; background: rgba(255,255,255,0.85); border:1px solid rgba(229,231,235,0.9); box-shadow: 0 10px 26px rgba(0,0,0,0.05); }
.feature-pill h4 { margin:0 0 4px 0; }
.chart-card canvas { width:100%; }
.modal-overlay { position:fixed; inset:0; background: rgba(15,23,42,0.4); display:none; align-items:center; justify-content:center; padding:16px; z-index:1000; }
.modal-card { background: white; border-radius:16px; padding:20px; max-width:420px; width:100%; box-shadow: 0 22px 70px rgba(0,0,0,0.2); position:relative; }
.modal-close { position:absolute; top:10px; right:10px; border:none; background: transparent; font-size:22px; cursor:pointer; }
.modal-card .wa-box { margin-top:12px; padding:10px 12px; border-radius:12px; background: rgba(20,184,166,0.08); border:1px solid rgba(20,184,166,0.3); }
.modal-card .btn-primary.full { width:100%; text-align:center; margin-top:10px; }
.small-text { font-size:12px; }
.modal-open { overflow:hidden; }
.pill.warn { background: #fef3c7; color: #92400e; }
.pill.danger { background: #fee2e2; color: #b91c1c; }
.pill.muted { background: #e5e7eb; color: #374151; }
.nav-btn.disabled { opacity:0.5; cursor:not-allowed; }
.legend { margin-top:10px; display:flex; flex-direction:column; gap:4px; font-size:13px; color:#4b5563; }
.legend .dot { display:inline-block; width:12px; height:12px; border-radius:50%; margin-right:6px; }
.legend .answered { background:#22c55e; }
.legend .doubt { background:#f59e0b; }
.legend .unanswered { background:#9ca3af; }
.exam-questions { display:flex; flex-direction:column; gap:10px; }
.exam-actions { margin-top:10px; }
.timer-pill { background: rgba(255,255,255,0.85); border:1px solid #e5e7eb; padding:8px 12px; border-radius:12px; text-align:right; min-width:120px; }
.doubt-toggle { font-size:13px; color:#4b5563; }

/* Enhanced exam shell */
.exam-shell { display:flex; flex-direction:column; gap:12px; }
.exam-header { flex-wrap:wrap; gap:12px; align-items:flex-start; }
.exam-title h2 { margin:0 0 6px 0; }
.exam-meta { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.pill { display:inline-block; padding:6px 10px; border-radius:999px; background: rgba(79,70,229,0.12); color:#4338ca; font-weight:700; font-size:12px; }
.pill.alt { background: rgba(20,184,166,0.14); color:#0f766e; }
.exam-monitor { display:flex; gap:10px; align-items:flex-start; }
.exam-cam { width:200px; background: rgba(255,255,255,0.9); border:1px solid #e5e7eb; border-radius:12px; padding:8px; box-shadow:0 10px 24px rgba(0,0,0,0.08); }
.exam-cam video { width:100%; border-radius:10px; background:#000; }
.cam-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.cam-status { font-size:12px; color:#2563eb; }
.mobile-only { display:none; }
.subtest-actions { display:flex; flex-direction:column; gap:6px; }
.desktop-only { display:block; }
.nav-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.35); backdrop-filter: blur(2px); z-index:21; display:none; }
.nav-overlay.show { display:block; }
.nav-drawer-mobile { display:none; }
.exam-nav { position:relative; z-index:22; }
.exam-nav.open { transform: translateX(0); }
.toast-stack { position:fixed; top:16px; right:16px; display:flex; flex-direction:column; gap:10px; z-index:50; }
.toast { padding:10px 12px; border-radius:12px; box-shadow:0 12px 30px rgba(0,0,0,0.15); color:#0f172a; background:#fff; border:1px solid #e5e7eb; min-width:240px; }
.toast.info { border-color:#38bdf8; }
.toast.warn { border-color:#f59e0b; background:#fffbeb; }
.toast.danger { border-color:#f87171; background:#fef2f2; }
.toast-title { font-weight:700; margin-bottom:4px; }
.toast-text { font-size:13px; color:#4b5563; }

@media (max-width: 900px) {
  .exam-body { grid-template-columns: 1fr; }
  .exam-nav { order:2; }
  .tracker-hero { flex-direction: column; align-items:flex-start; }
  .tracker-lock { width:100%; text-align:left; min-width: auto; }
  .tracker-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .table th, .table td { padding: 8px; font-size: 13px; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-form { padding: 24px; }
}

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 14px; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 18px; }
  .flex { flex-wrap: wrap; }
  .between { align-items: flex-start; }
  .nav-shell { align-items: center; }
  .nav-toggle { display:block; margin-left: auto; }
  .nav-links, .nav-action {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    background: rgba(255,255,255,0.97);
    border:1px solid rgba(229,231,235,0.9);
    box-shadow: 0 16px 36px rgba(0,0,0,0.14);
    border-radius:14px;
    padding:10px;
    flex-direction: column;
    gap:8px;
    display:none;
    opacity:1;
    visibility:visible;
    pointer-events:auto;
  }
  .nav-shell.open .nav-links,
  .nav-shell.open .nav-action { display:flex; }
  .nav-action { align-items: flex-start; }
  .mobile-nav-extra { display:block; }
  .row { flex-direction: column; align-items: flex-start; }
  .profile-wrap { grid-template-columns: 1fr; }
  .timer-pill { width: 100%; text-align: left; }
  .bottom-nav { display:block; }
  body.glass-bg { padding-bottom: 74px; }
  .mobile-only { display:inline-block; }
  .desktop-only { display:none; }
  .exam-monitor { width:100%; justify-content:space-between; }
  .exam-cam { width:160px; }
  .exam-body { grid-template-columns: 1fr; }
  .exam-nav { position:fixed; top:0; right:0; bottom:0; width:80%; max-width:320px; transform: translateX(100%); transition: transform 0.2s ease; background:#fff; }
  .exam-nav.open { transform: translateX(0); }
}

@media (min-width: 1024px) {
  .grid { gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); }
  .card { padding: 20px 22px; }
  .card.hero { display:flex; flex-direction:column; gap:12px; box-shadow: 0 22px 60px rgba(15,23,42,0.15); }
  .quick-stats { grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap:12px; }
  .nav-shell { padding:14px 18px; }
  .nav-links a { padding:10px 14px; }
  .order-row { align-items:flex-start; }
}

/* Layout helpers */
.main-content { padding-top: 12px; min-height: 70vh; }
.fade-in { animation: fadeIn 0.5s ease forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 769px) {
  .nav-shell { flex-wrap:nowrap; }
  .nav-toggle { display:none; }
  .nav-links { position:static; background: transparent; border:none; box-shadow:none; padding:0; width:auto; flex-direction:row; gap:8px; transform:none; opacity:1; visibility:visible; pointer-events:auto; }
  .nav-action { position:static; display:flex; opacity:1; visibility:visible; pointer-events:auto; transform:none; }
}
