/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* ===== ROOT — INDIA ORANGE THEME ===== */
:root {
  --primary:       #F97316;
  --primary-dark:  #EA580C;
  --primary-mid:   #FB923C;
  --primary-light: #FFF7ED;
  --primary-xlight:#FFFBF5;
  --green:         #2E7D32;
  --green-light:   #E8F5E9;
  --red:           #C62828;
  --red-light:     #FFEBEE;
  --yellow:        #F57F17;
  --yellow-light:  #FFFDE7;
  --indigo:        #283593;
  --text:          #1A1A2E;
  --text-sub:      #6B7280;
  --border:        #E5E7EB;
  --bg:            #F8F9FA;
  --white:         #FFFFFF;
  --dark:          #1A1A2E;
  --shadow-sm:     0 1px 4px rgba(0,0,0,.06);
  --shadow:        0 2px 16px rgba(0,0,0,.09);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.13);
  --shadow-orange: 0 4px 20px rgba(230,81,0,.22);
  --radius:        10px;
  --radius-lg:     16px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ===== HEADER ===== */
.site-header {
  background: var(--dark);
  color: var(--white);
  padding: 0 28px;
  height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 16px rgba(0,0,0,.18);
  position: sticky; top: 0; z-index: 100;
}
.site-header .logo { font-size: 22px; font-weight: 900; letter-spacing: -.3px; }
.site-header .logo span { color: #FF6D00; }
.site-header .tagline { font-size: 12px; opacity: .6; letter-spacing: .2px; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(120deg, #EA580C 0%, #F97316 45%, #FB923C 100%);
  color: var(--white);
  padding: 18px 28px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; position: relative; }
.hero-text h1 { font-size: 21px; font-weight: 800; margin-bottom: 2px; letter-spacing: -.2px; }
.hero-text p  { font-size: 13px; opacity: .85; }
.hero .stats  { display: flex; gap: 24px; }
.hero .stat   { text-align: center; }
.hero .stat .num { font-size: 22px; font-weight: 800; color: #FFD54F; line-height: 1.2; }
.hero .stat .lbl { font-size: 10px; opacity: .8; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

/* ===== SECTOR SELECTOR ===== */
.sector-wrap {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 60%);
  border-bottom: 1px solid var(--border);
  padding: 24px 20px;
  display: flex; justify-content: center; align-items: center;
}
.sector-grid { display: flex; gap: 16px; justify-content: center; }

.sector-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px; border-radius: 18px;
  border: 2px solid var(--border); cursor: pointer;
  background: #ffffff;
  transition: all .28s cubic-bezier(.4,0,.2,1); color: var(--text);
  width: 310px; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.sector-card:hover {
  border-color: #fb923c;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(249,115,22,.18);
}
.sector-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  box-shadow: 0 6px 20px rgba(234,88,12,.22);
}
.sector-icon {
  font-size: 32px; flex-shrink: 0;
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(249,115,22,.1); border-radius: 14px;
}
.sector-card.active .sector-icon { background: rgba(234,88,12,.15); }
.sector-body { flex: 1; min-width: 0; }
.sector-title { font-size: 17px; font-weight: 900; letter-spacing: -.2px; }
.sector-card.active .sector-title { color: var(--primary); }
.sector-desc { font-size: 12px; color: var(--text-sub); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sector-count {
  display: inline-block; margin-top: 7px;
  font-size: 11px; font-weight: 700;
  color: var(--primary); background: rgba(234,88,12,.1);
  padding: 4px 10px; border-radius: 20px;
}
.sector-card.active .sector-count { background: var(--primary); color: #fff; }

/* ===== CATEGORY CARDS ===== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 8px 0; }
.cat-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 20px 12px 16px; background: var(--white); border: 2px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer; text-decoration: none; color: var(--text);
  transition: all .25s; position: relative; overflow: hidden;
}
.cat-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: var(--primary); transform: scaleX(0);
  transition: transform .25s; transform-origin: center;
}
.cat-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-card:hover::after { transform: scaleX(1); }
.cat-icon { font-size: 30px; margin-bottom: 8px; }
.cat-name { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.cat-sub  { font-size: 11px; color: var(--text-sub); margin-bottom: 10px; line-height: 1.5; }
.cat-count { font-size: 10px; font-weight: 700; background: var(--primary-light); color: var(--primary); padding: 3px 10px; border-radius: 20px; }
.cat-card:hover .cat-count { background: var(--primary); color: var(--white); }

/* ===== TAB BAR ===== */
.tab-bar {
  background: var(--white); border-bottom: 2px solid var(--border);
  padding: 0 28px; display: flex; gap: 2px; overflow-x: auto;
  position: sticky; top: 62px; z-index: 99;
}
.tab-btn {
  padding: 14px 18px; border: none; background: none;
  font-size: 14px; font-weight: 600; color: var(--text-sub);
  white-space: nowrap; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all .2s; font-family: inherit;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== SECTION WRAP ===== */
.section-wrap { max-width: 1200px; margin: 0 auto; padding: 28px 28px; }
.section-title {
  font-size: 12px; font-weight: 700; color: var(--text-sub);
  text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== EXAM CARDS ===== */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.exam-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm); border: 1.5px solid var(--border);
  transition: all .25s; cursor: pointer;
}
.exam-card:hover { border-color: var(--primary); box-shadow: var(--shadow-orange); transform: translateY(-3px); }
.exam-card .badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.badge-upsc    { background: #FFF3E0; color: #E65100; }
.badge-ssc     { background: #E8F5E9; color: #2E7D32; }
.badge-banking { background: #FFF8E1; color: #F57F17; }
.badge-railways{ background: #F3E5F5; color: #6A1B9A; }
.badge-defence { background: #FCE4EC; color: #AD1457; }
.badge-state   { background: #E0F2F1; color: #00695C; }
.badge-coming  { background: #F5F5F5; color: #9E9E9E; }

.exam-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.exam-card .meta { font-size: 12px; color: var(--text-sub); display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.exam-card .meta span { background: var(--bg); padding: 2px 8px; border-radius: 20px; }
.exam-card .start-btn {
  width: 100%; padding: 10px; background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: var(--white); border: none; border-radius: 8px; font-size: 14px; font-weight: 700;
  font-family: inherit; transition: all .2s; letter-spacing: .2px;
}
.exam-card .start-btn:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: var(--shadow-orange); }
.exam-card.coming-soon { opacity: .65; cursor: default; }
.exam-card.coming-soon:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow-sm); }
.exam-card.coming-soon .start-btn { background: #E0E0E0; color: #9E9E9E; }

/* ===== CONFIG MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,26,46,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal { background: var(--white); border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.modal h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.modal .modal-sub { font-size: 13px; color: var(--text-sub); margin-bottom: 20px; }
.modal .field { margin-bottom: 16px; }
.modal .field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-sub); }
.modal .field select, .modal .field input[type=range] { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; transition: border-color .2s; font-family: inherit; }
.modal .field select:focus { border-color: var(--primary); }
.range-val { font-weight: 800; color: var(--primary); margin-left: 8px; font-size: 16px; }
.modal .mode-toggle { display: flex; gap: 8px; }
.mode-btn { flex: 1; padding: 10px; border: 2px solid var(--border); background: none; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--text-sub); transition: all .2s; font-family: inherit; }
.mode-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-cancel { flex: 1; padding: 11px; border: 1.5px solid var(--border); background: none; border-radius: 8px; font-size: 14px; font-weight: 600; font-family: inherit; transition: background .2s; }
.btn-cancel:hover { background: var(--bg); }
.btn-start { flex: 2; padding: 11px; background: linear-gradient(135deg, var(--primary), var(--primary-mid)); color: var(--white); border: none; border-radius: 8px; font-size: 14px; font-weight: 800; font-family: inherit; transition: all .2s; }
.btn-start:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: var(--shadow-orange); }

/* ===== EXAM PAGE ===== */
.exam-topbar {
  background: var(--dark); color: var(--white);
  padding: 0 24px; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.exam-topbar .exam-title { font-size: 15px; font-weight: 700; }
.exam-topbar .exam-info  { font-size: 12px; opacity: .65; }
.timer {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); padding: 7px 16px;
  border-radius: 24px; font-size: 17px; font-weight: 800; font-family: monospace;
  letter-spacing: 1px;
}
.timer.warning { background: var(--yellow); animation: pulse .8s infinite; }
.timer.danger  { background: var(--red); animation: pulse .5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.7} }

.exam-layout { display: flex; min-height: calc(100vh - 58px); }

.question-panel { flex: 1; padding: 24px; max-width: 800px; }
.q-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.q-num   { font-size: 13px; font-weight: 700; color: var(--text-sub); }
.q-marks { font-size: 12px; background: var(--primary-light); color: var(--primary); padding: 4px 12px; border-radius: 20px; font-weight: 700; }
.q-topic { font-size: 12px; color: var(--primary); font-weight: 700; background: var(--primary-light); padding: 4px 12px; border-radius: 20px; }

.question-text {
  font-size: 16px; line-height: 1.85; margin-bottom: 22px;
  background: var(--white); padding: 22px 24px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow); border-left: 4px solid var(--primary);
  font-weight: 500;
}

.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.option {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px;
  background: var(--white); border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all .15s; user-select: none;
}
.option:hover { border-color: #FFAB76; background: var(--primary-xlight); }
.option.selected { border-color: var(--primary); background: var(--primary-light); }
.option.selected .opt-key { background: var(--primary); color: var(--white); border-color: var(--primary); }
.opt-key {
  min-width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0; transition: all .15s;
}
.opt-text { font-size: 14px; line-height: 1.6; padding-top: 3px; font-weight: 500; }

/* Bottom Controls */
.exam-controls {
  display: flex; gap: 10px; align-items: center;
  padding: 14px 24px; background: var(--white);
  border-top: 1px solid var(--border); position: sticky; bottom: 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
.btn-prev, .btn-next, .btn-flag, .btn-clear, .btn-submit {
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 700;
  border: none; transition: all .2s; font-family: inherit;
}
.btn-prev { background: var(--bg); border: 1.5px solid var(--border); color: var(--text); }
.btn-prev:hover { background: var(--border); }
.btn-next { background: var(--primary); color: var(--white); }
.btn-next:hover { background: var(--primary-dark); }
.btn-flag { background: #FFF8E1; color: var(--yellow); border: 1.5px solid #FFD54F; }
.btn-flag.flagged { background: #FF8F00; color: var(--white); border-color: #FF8F00; }
.btn-clear { background: none; color: var(--text-sub); font-size: 13px; border: 1.5px solid var(--border); padding: 8px 14px; font-weight: 600; }
.btn-submit { background: linear-gradient(135deg, var(--green), #43A047); color: var(--white); margin-left: auto; padding: 10px 28px; }
.btn-submit:hover { background: linear-gradient(135deg, #1B5E20, var(--green)); }

/* NAV SIDEBAR */
.nav-sidebar {
  width: 240px; background: var(--white); border-left: 1px solid var(--border);
  padding: 18px; overflow-y: auto; position: sticky;
  top: 58px; height: calc(100vh - 58px);
}
.nav-sidebar h4 { font-size: 12px; font-weight: 700; color: var(--text-sub); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 1px; }
.nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 16px; }
.nav-cell {
  height: 36px; border-radius: 8px; border: 1.5px solid var(--border);
  font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; background: var(--white); color: var(--text);
}
.nav-cell:hover { transform: scale(1.08); }
.nav-cell.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); color: var(--primary); }
.nav-cell.answered { background: var(--green); border-color: var(--green); color: var(--white); }
.nav-cell.flagged  { background: var(--yellow); border-color: var(--yellow); color: var(--white); }
.nav-cell.answered.flagged { background: #E65100; border-color: #E65100; color: var(--white); }
.nav-cell.visited  { background: #FFEBEE; border-color: #EF9A9A; color: var(--red); }

.nav-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-sub); }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot  { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.dot-answered   { background: var(--green); }
.dot-flagged    { background: var(--yellow); }
.dot-visited    { background: #EF9A9A; }
.dot-notvisited { background: var(--white); border: 1.5px solid var(--border); }

.nav-stats { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.nav-stat-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.nav-stat-row span:last-child { font-weight: 800; }

/* ===== RESULTS PAGE ===== */
.results-header {
  background: linear-gradient(120deg, #EA580C 0%, #F97316 50%, #FB923C 100%);
  color: var(--white); padding: 16px 28px;
  display: flex; align-items: center; gap: 18px;
}
.score-circle {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.15); border: 3px solid rgba(255,255,255,.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-circle .score-num { font-size: 20px; font-weight: 900; line-height: 1; }
.score-circle .score-max { font-size: 11px; opacity: .75; }
.results-header h2  { font-size: 16px; font-weight: 800; margin-bottom: 3px; }
.results-header .verdict { font-size: 13px; opacity: .9; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; max-width: 900px; margin: 14px auto; padding: 0 20px;
}
.stat-card { background: var(--white); border-radius: var(--radius); padding: 12px 8px; text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.stat-card .val { font-size: 22px; font-weight: 900; margin-bottom: 2px; }
.stat-card .lbl { font-size: 11px; color: var(--text-sub); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.val-green  { color: var(--green); }
.val-red    { color: var(--red); }
.val-blue   { color: var(--indigo); }
.val-orange { color: var(--primary); }

.review-wrap { max-width: 900px; margin: 0 auto; padding: 20px; }
.review-wrap h3 { font-size: 17px; font-weight: 800; margin-bottom: 14px; }

.review-q { background: var(--white); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; }
.review-q-header { padding: 14px 18px; display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; transition: background .15s; }
.review-q-header:hover { background: var(--bg); }
.rq-status { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--white); }
.rq-status.correct { background: var(--green); }
.rq-status.wrong   { background: var(--red); }
.rq-status.skipped { background: #9E9E9E; }
.rq-title  { flex: 1; font-size: 13px; font-weight: 600; }
.rq-marks  { font-size: 13px; font-weight: 800; }
.rq-marks.pos  { color: var(--green); }
.rq-marks.neg  { color: var(--red); }
.rq-marks.zero { color: #9E9E9E; }
.rq-toggle { font-size: 16px; color: var(--text-sub); transition: transform .2s; }
.rq-toggle.open { transform: rotate(180deg); }

.review-q-body { padding: 16px 18px; border-top: 1px solid var(--border); display: none; }
.review-q-body.open { display: block; }
.rq-question { font-size: 14px; margin-bottom: 14px; line-height: 1.75; font-weight: 500; }
.rq-options  { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rq-opt { padding: 10px 14px; border-radius: 8px; font-size: 14px; border: 1.5px solid var(--border); display: flex; gap: 10px; align-items: center; }
.rq-opt.user-selected { border-color: var(--red); background: var(--red-light); }
.rq-opt.correct-ans   { border-color: var(--green); background: var(--green-light); }
.rq-opt.user-selected.correct-ans { border-color: var(--green); background: var(--green-light); }
.explanation { background: #FFFDE7; border-left: 4px solid var(--yellow); padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.65; }
.explanation strong { color: var(--primary); }

.result-actions { display: flex; gap: 12px; justify-content: center; padding: 8px 24px 32px; }
.btn-action { padding: 12px 28px; border-radius: 8px; font-size: 14px; font-weight: 800; border: none; cursor: pointer; transition: all .2s; font-family: inherit; }
.btn-home  { background: var(--white); border: 2px solid var(--primary); color: var(--primary); }
.btn-home:hover { background: var(--primary-light); }
.btn-retry { background: linear-gradient(135deg, var(--primary), var(--primary-mid)); color: var(--white); }
.btn-retry:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: var(--shadow-orange); }

/* ===== LOADER ===== */
.loader-wrap {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.spinner {
  width: 44px; height: 44px; border: 4px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== CONFIRM MODAL ===== */
.confirm-modal { position: fixed; inset: 0; background: rgba(26,26,46,.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 300; padding: 16px; }
.confirm-modal.hidden { display: none; }
.confirm-box { background: var(--white); border-radius: var(--radius-lg); padding: 28px; max-width: 400px; width: 100%; text-align: center; box-shadow: var(--shadow-lg); }
.confirm-box h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.confirm-box p  { font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.confirm-box .confirm-stats { display: flex; gap: 16px; justify-content: center; margin: 16px 0; }
.confirm-box .cs { text-align: center; }
.confirm-box .cs .cv { font-size: 24px; font-weight: 900; }
.confirm-box .cs .cl { font-size: 11px; color: var(--text-sub); text-transform: uppercase; font-weight: 600; }
.confirm-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn-go-back { flex: 1; padding: 11px; border: 1.5px solid var(--border); background: none; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn-confirm-submit { flex: 1; padding: 11px; background: linear-gradient(135deg, var(--green), #43A047); color: var(--white); border: none; border-radius: 8px; font-size: 14px; font-weight: 800; cursor: pointer; font-family: inherit; }

/* ===== STATE SELECTOR ===== */
.state-intro { font-size: 14px; color: var(--text-sub); margin-bottom: 24px; padding: 10px 14px; background: var(--primary-light); border-radius: 8px; border-left: 4px solid var(--primary); font-weight: 500; }
.region-block { margin-bottom: 28px; }
.region-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; padding: 4px 14px; border-radius: 20px; display: inline-block; margin-bottom: 12px; }
.region-label.north    { background: #FFF3E0; color: #E65100; }
.region-label.east     { background: #E8F5E9; color: #2E7D32; }
.region-label.west     { background: #FFF8E1; color: #F57F17; }
.region-label.central  { background: #F3E5F5; color: #6A1B9A; }
.region-label.south    { background: #E0F2F1; color: #00695C; }
.region-label.northeast{ background: #FCE4EC; color: #AD1457; }

.state-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.state-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 14px; background: var(--white); border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all .2s;
  min-width: 86px; text-align: center; text-decoration: none; color: var(--text);
}
.state-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-orange); }
.state-card.hot { border-color: #FFAB76; background: var(--primary-xlight); }
.state-card.hot:hover { border-color: var(--primary); }
.state-code  { font-size: 14px; font-weight: 900; color: var(--primary); margin-bottom: 2px; }
.state-name  { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.state-count { font-size: 11px; color: var(--text-sub); }

/* ===== STATE PAGE ===== */
.back-link { font-size: 13px; color: rgba(255,255,255,.8); font-weight: 700; padding: 6px 14px; border-radius: 20px; border: 1.5px solid rgba(255,255,255,.3); transition: all .2s; }
.back-link:hover { background: rgba(255,255,255,.15); color: var(--white); }

.state-pg-header { display: flex; align-items: center; gap: 20px; background: linear-gradient(120deg, var(--primary-dark), var(--primary)); color: var(--white); padding: 20px 28px; }
.state-pg-code { width: 60px; height: 60px; border-radius: 12px; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 900; flex-shrink: 0; }
.state-pg-name { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.state-pg-meta { font-size: 13px; opacity: .85; }

/* ===== AUTH PAGE ===== */
.auth-body { background: var(--bg); min-height: 100vh; display: flex; align-items: stretch; }
.auth-page  { display: flex; width: 100%; min-height: 100vh; }

.auth-left {
  width: 420px; flex-shrink: 0;
  background: linear-gradient(160deg, #EA580C 0%, #F97316 50%, #FB923C 100%);
  color: var(--white); padding: 48px 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Ccircle cx='30' cy='30' r='5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-brand { position: relative; }
.auth-logo  { font-size: 30px; font-weight: 900; margin-bottom: 8px; }
.auth-logo span { color: #FFD54F; }
.auth-tagline { font-size: 15px; opacity: .85; line-height: 1.6; margin-bottom: 40px; }
.auth-features { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; position: relative; }
.auth-feat { display: flex; align-items: center; gap: 12px; font-size: 14px; opacity: .95; font-weight: 500; }
.feat-icon { width: 24px; height: 24px; border-radius: 50%; background: #FFD54F; color: #BF360C; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; flex-shrink: 0; }
.auth-stats { display: flex; gap: 28px; position: relative; }
.auth-stat  { text-align: center; }
.as-num { font-size: 26px; font-weight: 900; color: #FFD54F; }
.as-lbl { font-size: 11px; opacity: .75; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

.auth-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-card  { background: var(--white); border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }

.auth-toggle { display: flex; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 24px; }
.auth-toggle-btn { flex: 1; padding: 10px; border: none; background: none; border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--text-sub); cursor: pointer; transition: all .2s; font-family: inherit; }
.auth-toggle-btn.active { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }

.auth-title { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.auth-sub   { font-size: 13px; color: var(--text-sub); margin-bottom: 22px; }

.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-sub); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }
.auth-field input, .auth-field select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .2s; background: var(--white);
}
.auth-field input:focus, .auth-field select:focus { border-color: var(--primary); }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 60px; }
.pass-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 12px; font-weight: 700; color: var(--primary); cursor: pointer; padding: 4px; }

.auth-row  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 13px; }
.auth-check { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; }
.auth-link  { color: var(--primary); font-weight: 700; }

.auth-error { background: var(--red-light); color: var(--red); border: 1px solid #EF9A9A; border-radius: 8px; padding: 9px 14px; font-size: 13px; margin-bottom: 12px; font-weight: 600; }

.auth-submit { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--primary), var(--primary-mid)); color: var(--white); border: none; border-radius: 10px; font-size: 15px; font-weight: 800; cursor: pointer; transition: all .2s; margin-bottom: 16px; font-family: inherit; letter-spacing: .2px; }
.auth-submit:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: var(--shadow-orange); }

.auth-divider { text-align: center; margin-bottom: 14px; position: relative; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.auth-divider span { background: var(--white); padding: 0 12px; font-size: 12px; color: var(--text-sub); position: relative; font-weight: 600; }

.google-btn { width: 100%; padding: 11px; background: var(--white); border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all .2s; margin-bottom: 16px; font-family: inherit; }
.google-btn:hover { border-color: #bbb; background: #fafafa; box-shadow: var(--shadow-sm); }

.auth-switch { text-align: center; font-size: 13px; color: var(--text-sub); font-weight: 500; }
.auth-switch a { color: var(--primary); font-weight: 800; }

/* Header auth */
.user-chip { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); padding: 5px 14px; border-radius: 24px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s; }
.user-chip:hover { background: rgba(255,255,255,.22); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: #F97316; color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; }
.btn-login-header { padding: 7px 18px; background: rgba(255,109,0,.15); border: 1.5px solid rgba(255,109,0,.5); border-radius: 24px; color: #FF9E57; font-size: 13px; font-weight: 800; cursor: pointer; transition: all .2s; font-family: inherit; }
.btn-login-header:hover { background: rgba(255,109,0,.3); border-color: #FF6D00; color: #FFB74D; }

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #BDBDBD; }

/* ===== RESPONSIVE ===== */

/* --- Tablet (max 1024px) --- */
@media (max-width: 1024px) {
  .nav-sidebar { width: 200px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .auth-left { width: 340px; padding: 36px 28px; }
}

/* --- Small Tablet / Large Mobile (max 768px) --- */
@media (max-width: 768px) {
  /* Header */
  .site-header { padding: 0 16px; height: 56px; }
  .site-header .logo { font-size: 18px; }

  /* Hero — stack vertically */
  .hero { padding: 14px 16px; }
  .hero-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-text h1 { font-size: 16px; }
  .hero-text p  { font-size: 12px; }
  .hero .stats  { gap: 16px; width: 100%; justify-content: space-between; }
  .hero .stat .num { font-size: 18px; }

  /* Sector cards — mobile */
  .sector-wrap { padding: 12px 14px; }
  .sector-grid { gap: 8px; }
  .sector-card { width: 185px; padding: 14px 14px; gap: 12px; }
  .sector-icon { font-size: 22px; width: 42px; height: 42px; border-radius: 11px; }
  .sector-title { font-size: 14px; }
  .sector-desc { display: none; }
  .sector-count { font-size: 10px; padding: 3px 8px; }

  /* Section wrap */
  .section-wrap { padding: 16px; }

  /* Category cards — 2 columns */
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-icon { font-size: 30px; margin-bottom: 8px; }
  .cat-name { font-size: 15px; }
  .cat-sub  { font-size: 11px; margin-bottom: 8px; }
  .cat-card { padding: 20px 12px 16px; }

  /* Exam grid — 1 column */
  .exam-grid { grid-template-columns: 1fr; }

  /* Tab bar */
  .tab-bar { padding: 0 12px; top: 56px; }
  .tab-btn { padding: 12px 12px; font-size: 13px; }

  /* Exam page */
  .exam-topbar { padding: 0 14px; height: 52px; }
  .exam-topbar .exam-title { font-size: 13px; }
  .exam-topbar .exam-info  { display: none; }
  .timer { font-size: 15px; padding: 5px 12px; }
  .exam-layout { flex-direction: column; }
  .question-panel { padding: 14px; max-width: 100%; }
  .question-text { font-size: 14px; padding: 16px; }
  .opt-text { font-size: 13px; }

  /* Nav sidebar — horizontal strip at bottom */
  .nav-sidebar {
    width: 100%; height: auto; position: static;
    border-left: none; border-top: 2px solid var(--border);
    padding: 12px 16px;
  }
  .nav-grid { grid-template-columns: repeat(8, 1fr); }
  .nav-cell { height: 32px; font-size: 11px; border-radius: 6px; }

  /* Bottom controls */
  .exam-controls { padding: 10px 14px; gap: 7px; flex-wrap: wrap; }
  .btn-prev, .btn-next, .btn-flag, .btn-submit { padding: 9px 14px; font-size: 13px; }
  .btn-clear { display: none; }
  .btn-submit { margin-left: 0; flex: 1; }

  /* Results */
  .results-header { padding: 14px 16px; gap: 14px; }
  .score-circle { width: 60px; height: 60px; }
  .score-circle .score-num { font-size: 18px; }
  .results-header h2 { font-size: 14px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); padding: 0 12px; gap: 8px; }
  .review-wrap { padding: 12px 14px; }
  .result-actions { flex-direction: column; padding: 8px 16px 24px; }
  .btn-action { width: 100%; }

  /* State grid */
  .state-pg-header { padding: 16px; }
  .state-pg-name { font-size: 18px; }
  .state-card { min-width: 80px; padding: 10px 12px; }
  .state-code { font-size: 13px; }
  .state-name { font-size: 11px; }

  /* Auth */
  .auth-left  { display: none; }
  .auth-right { padding: 20px 16px; }
  .auth-card  { padding: 24px 20px; }
  .auth-title { font-size: 20px; }

  /* Modal */
  .modal { padding: 22px 18px; }
  .confirm-box { padding: 22px 18px; }
}

/* --- Mobile (max 480px) --- */
@media (max-width: 480px) {
  /* Sector cards — stack on very small screens */
  .sector-grid { grid-template-columns: 1fr; }
  .sector-card { padding: 12px 14px; }

  /* Category cards — 2 cols compact */
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-card { padding: 16px 10px 14px; border-radius: 10px; }
  .cat-icon { font-size: 26px; margin-bottom: 6px; }
  .cat-name { font-size: 14px; }
  .cat-sub  { display: none; }

  /* Hero stats — compact row */
  .hero .stat .num { font-size: 16px; }
  .hero .stat .lbl { font-size: 9px; }

  /* Nav grid — more columns */
  .nav-grid { grid-template-columns: repeat(10, 1fr); gap: 4px; }
  .nav-cell { height: 28px; font-size: 10px; border-radius: 4px; }

  /* Stats grid — 2 cols */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tab bar — smaller font */
  .tab-btn { padding: 10px 8px; font-size: 12px; }

  /* Question */
  .question-text { font-size: 13px; padding: 14px; }
  .option { padding: 11px 12px; gap: 10px; }
  .opt-key { min-width: 28px; height: 28px; font-size: 12px; }
}
