/* ===== MHT-CET Exam System ===== */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }
body { background: #eef2f7; color: #222; }

/* --- AUTH PAGES --- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); padding: 20px;
}
.auth-card {
  background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
  width: 100%; max-width: 480px; padding: 32px;
}
.auth-card h1 { color: #1e3c72; font-size: 22px; text-align: center; margin-bottom: 8px; }
.auth-card p.sub { text-align: center; color: #666; font-size: 13px; margin-bottom: 22px; }
.auth-card .tabs { display: flex; margin-bottom: 22px; border-bottom: 2px solid #e0e6ef; }
.auth-card .tabs button {
  flex: 1; padding: 10px; background: none; border: none; cursor: pointer;
  font-weight: 600; color: #888;
}
.auth-card .tabs button.active { color: #1e3c72; border-bottom: 3px solid #1e3c72; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #333; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid #d6dde6; border-radius: 8px;
  font-size: 14px; transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: #2a5298;
}
.btn {
  display: inline-block; padding: 11px 22px; background: #1e3c72; color: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: background .2s; text-decoration: none;
}
.btn:hover { background: #2a5298; }
.btn.full { width: 100%; }
.btn-success { background: #28a745; } .btn-success:hover { background: #218838; }
.btn-danger  { background: #dc3545; } .btn-danger:hover  { background: #c82333; }
.btn-warn    { background: #ffc107; color: #333; } .btn-warn:hover { background: #e0a800; }
.btn-info    { background: #17a2b8; } .btn-info:hover { background: #138496; }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.alert-error   { background: #ffe5e5; color: #b30000; border-left: 4px solid #b30000; }
.alert-success { background: #e3f9e5; color: #146c2e; border-left: 4px solid #146c2e; }
.alert-info    { background: #e3f0ff; color: #0a3a6b; border-left: 4px solid #0a3a6b; }

.qr-box {
  text-align: center; padding: 14px; border: 2px dashed #2a5298; border-radius: 10px;
  margin: 14px 0; background: #f7faff;
}
.qr-box img { max-width: 200px; margin-bottom: 8px; }
.qr-box .upi { font-weight: 700; color: #1e3c72; }

/* --- INSTRUCTIONS PAGE --- */
.inst-wrap { max-width: 900px; margin: 30px auto; background: #fff; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08); padding: 30px; }
.inst-wrap h1 { color: #1e3c72; margin-bottom: 20px; border-bottom: 2px solid #1e3c72; padding-bottom: 10px; }
.inst-wrap ul { margin: 14px 0 14px 22px; }
.inst-wrap li { margin-bottom: 8px; line-height: 1.6; }
.legend-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.legend-table th, .legend-table td { padding: 10px; border: 1px solid #ddd; text-align: left; }
.legend-table th { background: #1e3c72; color: #fff; }

/* --- EXAM PAGE --- */
.exam-top {
  background: #1e3c72; color: #fff; padding: 10px 18px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 100;
}
.exam-top .name { font-weight: 600; }
.exam-top .timer { font-size: 18px; font-weight: 700; background: #c0392b; padding: 6px 14px; border-radius: 6px; }
.exam-top .timer.warn { background: #e67e22; }
.exam-top .timer.danger { background: #c0392b; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% {opacity:1;} 50% {opacity:.6;} }

.section-tabs {
  background: #fff; padding: 10px 18px; border-bottom: 1px solid #ddd;
  display: flex; gap: 10px;
}
.section-tabs button {
  padding: 8px 18px; border: 1px solid #1e3c72; background: #fff; color: #1e3c72;
  border-radius: 6px; cursor: pointer; font-weight: 600;
}
.section-tabs button.active { background: #1e3c72; color: #fff; }
.section-tabs button:disabled { opacity: .5; cursor: not-allowed; }

.exam-body { display: grid; grid-template-columns: 1fr 320px; gap: 16px; padding: 16px; }
@media (max-width: 900px) { .exam-body { grid-template-columns: 1fr; } }

.q-panel { background: #fff; border-radius: 8px; padding: 22px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.q-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 2px solid #f0f0f0; }
.q-header h3 { color: #1e3c72; }
.q-text { font-size: 16px; line-height: 1.7; margin-bottom: 14px; }
.q-image { max-width: 100%; max-height: 280px; margin: 10px 0; border-radius: 6px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px; margin-bottom: 8px;
  border: 1.5px solid #e0e6ef; border-radius: 8px; cursor: pointer; transition: all .15s;
}
.opt:hover { background: #f7faff; border-color: #2a5298; }
.opt input { margin-top: 4px; }
.opt.selected { background: #e3f0ff; border-color: #1e3c72; }
.opt img { max-height: 90px; max-width: 240px; }

.q-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid #f0f0f0; }

/* --- PALETTE --- */
.palette-box { background: #fff; border-radius: 8px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.palette-box h4 { color: #1e3c72; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #eee; }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; }
.pbtn {
  width: 100%; aspect-ratio: 1; border: 1px solid #aaa; border-radius: 4px;
  background: #e6e6e6; cursor: pointer; font-weight: 600; font-size: 13px; color: #333;
}
.pbtn.notvisited { background: #d3d3d3; color: #333; }
.pbtn.notanswered { background: #e74c3c; color: #fff; border-color: #c0392b; }
.pbtn.answered    { background: #28a745; color: #fff; border-color: #1e7e34; }
.pbtn.review      { background: #8e44ad; color: #fff; border-color: #6c3483; }
.pbtn.review-ans  { background: linear-gradient(135deg,#28a745 50%,#8e44ad 50%); color:#fff; }
.pbtn.current     { box-shadow: 0 0 0 3px #ffd700; }

.legend { font-size: 12px; }
.legend div { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.legend .sw { width: 16px; height: 16px; border-radius: 3px; border: 1px solid #888; }

.summary-stats { background: #f7faff; padding: 10px; border-radius: 6px; margin-top: 12px; font-size: 13px; }
.summary-stats div { display: flex; justify-content: space-between; padding: 3px 0; }

/* --- RESULT --- */
.result-wrap { max-width: 900px; margin: 30px auto; background: #fff; padding: 30px; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.result-wrap h1 { color: #1e3c72; text-align: center; margin-bottom: 20px; }
.score-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin: 20px 0; }
.score-box { padding: 18px; border-radius: 8px; text-align: center; color: #fff; }
.score-box h3 { font-size: 14px; opacity: .9; }
.score-box .num { font-size: 30px; font-weight: 700; margin-top: 6px; }
.bg-blue { background: #1e3c72; } .bg-green { background: #28a745; }
.bg-red { background: #dc3545; } .bg-orange { background: #e67e22; }
.bg-purple { background: #8e44ad; }

.review-block { margin-top: 20px; }
.review-q { background: #fafbfc; padding: 14px; border-radius: 8px; margin-bottom: 12px; border-left: 4px solid #1e3c72; }
.review-q.correct { border-left-color: #28a745; }
.review-q.wrong   { border-left-color: #dc3545; }
.review-q.skip    { border-left-color: #aaa; }
.review-q .meta   { font-size: 12px; color: #666; margin-top: 6px; }

/* --- ADMIN --- */
.admin-wrap { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: #1e3c72; color: #fff; padding: 20px; }
.admin-sidebar h2 { font-size: 18px; margin-bottom: 22px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.2); }
.admin-sidebar a { display: block; padding: 10px 12px; color: #cfd8e3; text-decoration: none;
  border-radius: 6px; margin-bottom: 4px; font-size: 14px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.12); color: #fff; }
.admin-main { padding: 24px; background: #f3f6fa; }
.admin-main h1 { color: #1e3c72; margin-bottom: 20px; }
.card { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.05); margin-bottom: 18px; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 10px; border-bottom: 1px solid #eee; text-align: left; font-size: 13px; }
table.data th { background: #1e3c72; color: #fff; }
table.data tr:hover { background: #f7faff; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-grid .card { text-align: center; }
.stat-grid h3 { font-size: 13px; color: #666; }
.stat-grid .num { font-size: 30px; font-weight: 700; color: #1e3c72; margin-top: 6px; }

@media print {
 .no-print { display: none !important; }
 body { background: #fff; }
 .result-wrap { box-shadow: none; }
}
