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

/* ---------- LOGIN PAGE ---------- */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-wrapper { width: 100%; max-width: 420px; }
.login-card {
    background: #fff; border-radius: 14px; padding: 35px 30px;
    box-shadow: 0 18px 45px rgba(0,0,0,.25);
}
.login-header { text-align: center; margin-bottom: 25px; }
.login-header h1 { color: #1e3c72; font-size: 32px; }
.login-header p  { color: #666; margin-top: 4px; }
.tabs { display: flex; border-bottom: 2px solid #eee; margin-bottom: 20px; }
.tab-btn {
    flex: 1; padding: 12px; background: none; border: none; cursor: pointer;
    font-size: 15px; font-weight: 600; color: #888; transition: .2s;
}
.tab-btn.active { color: #1e3c72; border-bottom: 3px solid #1e3c72; margin-bottom: -2px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content label { display: block; font-size: 13px; color: #444; margin: 12px 0 5px; font-weight: 600; }
.tab-content input {
    width: 100%; padding: 11px 12px; border: 1px solid #ccd; border-radius: 6px; font-size: 14px;
    transition: .2s;
}
.tab-content input:focus { border-color: #1e3c72; outline: none; box-shadow: 0 0 0 3px rgba(30,60,114,.12); }
.btn-primary {
    width: 100%; margin-top: 20px; padding: 12px; background: #1e3c72; color: #fff;
    border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: .2s;
}
.btn-primary:hover { background: #16305c; }
.login-footer { text-align: center; margin-top: 18px; }
.login-footer a { color: #888; font-size: 13px; text-decoration: none; }
.login-footer a:hover { color: #1e3c72; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.alert-error   { background: #fde8e8; color: #b1383a; border: 1px solid #f5c6c8; }
.alert-success { background: #e0f5e6; color: #1e7a3e; border: 1px solid #b8e0c4; }

/* ---------- INSTRUCTIONS PAGE ---------- */
.instr-body { background: #f4f6fb; padding: 20px; }
.instr-wrapper { max-width: 1100px; margin: 0 auto; background: #fff; border: 1px solid #d6dde8; border-radius: 6px; }
.instr-header {
    background: #1f2840; color: #fff; padding: 12px 18px;
    border-radius: 6px 6px 0 0;
}
.instr-header h2 { font-size: 18px; }
.examinee-details, .instructions { padding: 16px 22px; border-bottom: 1px solid #e3e7ee; }
.examinee-details h3, .instructions h3 { font-size: 16px; color: #1f2840; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid #e3e7ee; }
.examinee-details table { width: 100%; }
.examinee-details td { padding: 6px 8px; font-size: 14px; }
.instructions ul { margin: 8px 0 14px 22px; }
.instructions li { margin-bottom: 6px; font-size: 14px; }
.legend-table { width: 100%; max-width: 540px; margin: 8px 0 14px; border-collapse: collapse; }
.legend-table th, .legend-table td { border: 1px solid #d6dde8; padding: 7px 10px; font-size: 14px; text-align: left; }
.legend-table th { background: #d6e4f5; color: #1f2840; }
.legend-box { display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center; color: #fff; font-weight: 700; border-radius: 50%; font-size: 12px; }
.legend-box.gray   { background: #b6bdca; color: #333; }
.legend-box.red    { background: #e94e4e; }
.legend-box.green  { background: #2ea84b; }
.legend-box.purple { background: #7d3cb5; }
.legend-box.dual   { background: linear-gradient(135deg, #2ea84b 50%, #7d3cb5 50%); }
.accept-form { padding: 16px 22px; background: #fbeef3; border-top: 2px solid #c46e92; }
.accept-line { display: flex; align-items: center; gap: 8px; color: #b32a5b; font-weight: 600; font-size: 14px; }
.btn-login { max-width: 240px; margin: 14px 0 4px auto; display: block; }

/* ---------- EXAM INTERFACE ---------- */
.exam-body { background: #fff; height: 100vh; overflow: hidden; }
.exam-header {
    background: #1f2840; color: #fff; padding: 8px 16px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px;
}
.hdr-right #timer { color: #ffd455; font-weight: 700; font-family: 'Courier New', monospace; }

.exam-main { display: flex; height: calc(100vh - 40px); }

/* LEFT palette */
.palette-pane {
    width: 240px; background: #f4f6fb; border-right: 1px solid #d6dde8;
    display: flex; flex-direction: column; overflow: hidden;
}
.section-tabs { display: flex; }
.sec-tab {
    flex: 1; padding: 9px 4px; background: #e1e6ef; border: none; cursor: pointer;
    font-size: 12px; font-weight: 600; color: #444; border-right: 1px solid #c5cad3;
    transition: .15s;
}
.sec-tab:last-child { border-right: none; }
.sec-tab.active { background: #1f2840; color: #fff; }
.sec-tab.locked { background: #cfd4dd; color: #888; cursor: not-allowed; }

.palette-grid {
    padding: 10px; display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 6px; overflow-y: auto; flex: 1;
}
.p-btn {
    width: 36px; height: 32px; border: 1px solid #aab2c2; background: #fff;
    cursor: pointer; font-size: 12px; font-weight: 700; border-radius: 3px;
    transition: .12s; color: #222;
}
.p-btn:hover { transform: scale(1.07); }
.p-btn.current { outline: 2px solid #ff8800; outline-offset: 1px; }
.p-not-visited     { background: #ffffff; color: #333; }
.p-not-answered    { background: #e94e4e; color: #fff; border-color: #c33; }
.p-answered        { background: #2ea84b; color: #fff; border-color: #228938; }
.p-marked          { background: #7d3cb5; color: #fff; border-color: #5e2989; }
.p-answered-marked { background: linear-gradient(135deg, #2ea84b 50%, #7d3cb5 50%); color: #fff; border-color: #5e2989; }

.summary-box {
    background: #d6e4f5; border-top: 1px solid #b6c7df; padding: 10px 14px;
}
.summary-box h4 {
    text-align: center; background: #d6e4f5; padding: 4px; font-size: 13px;
    color: #1f2840; margin-bottom: 8px;
}
.sum-row { display: flex; justify-content: space-between; align-items: center; margin: 5px 0; font-size: 13px; }
.sum-pill {
    min-width: 28px; height: 22px; padding: 0 6px; border-radius: 11px; line-height: 22px;
    text-align: center; color: #fff; font-weight: 700; font-size: 12px;
}
.sum-pill.gray   { background: #b6bdca; color: #333; }
.sum-pill.red    { background: #e94e4e; }
.sum-pill.green  { background: #2ea84b; }
.sum-pill.purple { background: #7d3cb5; }
.sum-pill.dual   { background: linear-gradient(135deg, #2ea84b 50%, #7d3cb5 50%); }

/* RIGHT question area */
.question-pane { flex: 1; display: flex; flex-direction: column; background: #fff; overflow: hidden; }
.qbar {
    background: #f4f6fb; border-bottom: 1px solid #d6dde8; padding: 8px 16px;
    display: flex; align-items: center; justify-content: space-between; font-size: 13px;
}
.mark-rev { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.qbar-mid { color: #1976d2; text-decoration: underline; cursor: pointer; }

.question-container { flex: 1; padding: 22px 28px; overflow-y: auto; }
.q-title { font-size: 16px; color: #1f2840; margin-bottom: 14px; }
.q-text { font-size: 15px; margin-bottom: 16px; line-height: 1.7; }
.q-image { margin: 14px 0; }
.q-image img { max-width: 100%; max-height: 300px; border: 1px solid #ccd; border-radius: 4px; }
.q-options { margin-top: 18px; }
.opt-row {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 8px;
    border: 1px solid #e3e7ee; border-radius: 4px; cursor: pointer; font-size: 14px;
    transition: .15s;
}
.opt-row:hover { background: #f4f6fb; border-color: #b8c2d4; }
.opt-row input { transform: scale(1.1); }
.opt-letter { font-weight: 600; color: #1f2840; min-width: 22px; }

.action-bar {
    border-top: 1px solid #d6dde8; padding: 10px 16px; background: #f4f6fb;
    display: flex; gap: 8px; flex-wrap: wrap;
}
.btn {
    padding: 8px 16px; border: 1px solid transparent; border-radius: 4px; cursor: pointer;
    font-size: 13px; font-weight: 600; transition: .15s;
}
.btn-default { background: #fff; border-color: #b8c2d4; color: #1f2840; }
.btn-default:hover { background: #f0f3f9; }
.btn.btn-primary { background: #1976d2; color: #fff; border-color: #1565c0; width: auto; margin: 0; }
.btn.btn-primary:hover { background: #1565c0; }
.btn-warn { background: #ff9800; color: #fff; border-color: #e08600; }
.btn-warn:hover { background: #e08600; }
.btn-danger { background: #d32f2f; color: #fff; border-color: #b71c1c; margin-left: auto; }
.btn-danger:hover { background: #b71c1c; }

/* ---------- RESULT PAGE ---------- */
.result-body { background: #f4f6fb; padding: 20px; }
.result-wrap { max-width: 1100px; margin: 0 auto; background: #fff; border-radius: 8px; padding: 30px; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.result-header { text-align: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid #eef; }
.result-header h1 { color: #1f2840; }
.result-header p  { color: #666; margin-top: 4px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.info-card { padding: 18px; border: 1px solid #e3e7ee; border-radius: 8px; background: #fafbfd; }
.info-card h4 { font-size: 13px; color: #888; text-transform: uppercase; margin-bottom: 8px; }
.info-card .big { font-size: 26px; font-weight: 700; color: #1f2840; }
.score-card { background: linear-gradient(135deg, #1e3c72, #2a5298); color: #fff; }
.score-card h4, .score-card .muted { color: #cfd9eb; }
.score-card .big { color: #fff; }
.muted { color: #888; }
.ok-text { color: #2ea84b; font-weight: 600; }
.err-text { color: #e94e4e; font-weight: 600; }

.section-analysis { margin-top: 28px; }
.section-analysis h3 { color: #1f2840; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid #eef; }
.rtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.rtable th, .rtable td { padding: 9px 12px; border: 1px solid #e3e7ee; text-align: left; }
.rtable th { background: #1f2840; color: #fff; }
.rtable tbody tr:nth-child(even) { background: #fafbfd; }

.result-actions {
    max-width: 1100px; margin: 18px auto; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.result-actions .btn { padding: 10px 24px; }

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

/* ---------- ADMIN ---------- */
.admin-body { background: #f4f6fb; min-height: 100vh; }
.admin-nav {
    background: #1f2840; color: #fff; padding: 12px 22px;
    display: flex; justify-content: space-between; align-items: center;
}
.admin-nav h2 { font-size: 18px; }
.admin-nav a { color: #cfd9eb; text-decoration: none; margin-left: 14px; font-size: 14px; }
.admin-nav a:hover { color: #fff; }
.admin-wrap { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.admin-card { background: #fff; border-radius: 8px; padding: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.05); margin-bottom: 22px; }
.admin-card h3 { color: #1f2840; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #eef; }
.admin-card label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 13px; color: #444; }
.admin-card input[type=text], .admin-card input[type=email],
.admin-card input[type=password], .admin-card select,
.admin-card textarea, .admin-card input[type=file] {
    width: 100%; padding: 9px; border: 1px solid #ccd; border-radius: 4px; font-size: 14px;
    font-family: inherit;
}
.admin-card textarea { min-height: 70px; resize: vertical; }
.admin-card .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 800px) {
    .palette-pane { width: 200px; }
    .admin-card .row { grid-template-columns: 1fr; }
}
