/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e3a8a;
    --primary-dark: #1e40af;
    --secondary-color: #0f766e;
    --accent-color: #dc2626;
    --success-color: #059669;
    --warning-color: #d97706;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 1.8rem;
    color: #60a5fa;
}

.logo-mark {
    height: 48px;
    width: auto;
    padding: 3px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.brand-name {
    font-size: 1.25rem;
}

.brand-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-left: 3.55rem;
}

.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid transparent;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
}

/* Sections */
.section {
    display: none;
    min-height: calc(100vh - 80px);
}

.section.active {
    display: block;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    text-align: center;
    background: linear-gradient(to bottom, var(--bg-primary), #e0f2fe);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.stat-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cta-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Auth Sections */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

.auth-card {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.875rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.admin-note {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-light);
}

/* Instructions */
.instructions-container {
    background: var(--bg-secondary);
    max-width: 900px;
    margin: 2rem auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.instructions-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.instructions-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.instructions-content {
    padding: 2rem;
}

.instruction-group {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.instruction-group h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
}

.instruction-group ul {
    list-style: none;
    padding-left: 0;
}

.instruction-group li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-primary);
}

.instruction-group li:before {
    content: "▸";
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.candidate-info-display {
    background: #eff6ff;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #93c5fd;
}

.candidate-info-display h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.candidate-info-display p {
    margin: 0.25rem 0;
    color: var(--text-primary);
}

.instructions-actions {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--bg-primary);
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--success-color) 0%, #047857 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--text-light);
}

/* Assessment Section */
.assessment-header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.assessment-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.assessment-info h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.assessment-info span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.timer-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fef2f2;
    color: var(--accent-color);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.125rem;
    border: 2px solid #fecaca;
}

.submit-exam-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-exam-btn:hover {
    background: #b91c1c;
    transform: translateY(-2px);
}

.section-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.section-tab {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-tab:hover {
    background: #e0f2fe;
    border-color: #93c5fd;
}

.section-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.assessment-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.question-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.question-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.question-number {
    font-weight: 600;
    color: var(--primary-color);
}

.question-marks {
    color: var(--success-color);
    font-weight: 600;
}

.mark-review-btn {
    background: #fef3c7;
    color: var(--warning-color);
    border: 2px solid #fde68a;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mark-review-btn:hover {
    background: #fde68a;
}

.question-content {
    padding: 1.5rem;
}

.question-content h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item:hover {
    background: #e0f2fe;
    border-color: #93c5fd;
}

.option-item input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    margin-top: 0.125rem;
}

.option-item label {
    cursor: pointer;
    flex: 1;
    color: var(--text-primary);
    line-height: 1.6;
}

.pseudocode-container textarea,
.coding-container textarea {
    width: 100%;
    min-height: 250px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    line-height: 1.5;
}

.pseudocode-container textarea:focus,
.coding-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.coding-header {
    margin-bottom: 0.75rem;
}

.coding-header select {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.test-cases {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.test-cases h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.test-cases pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.75rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.4;
}

.question-navigation {
    display: flex;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--bg-primary);
    border-top: 2px solid var(--border-color);
}

.nav-q-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-q-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Question Palette */
.question-palette {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.palette-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.palette-header h4 {
    color: var(--primary-color);
    font-size: 1.125rem;
}

.palette-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid;
}

.legend-dot.answered {
    background: var(--success-color);
    border-color: var(--success-color);
}

.legend-dot.not-answered {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.legend-dot.review {
    background: var(--warning-color);
    border-color: var(--warning-color);
}

.legend-dot.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.3);
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.375rem;
}

.palette-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.palette-btn:hover {
    background: #e0f2fe;
    border-color: #93c5fd;
}

.palette-btn.answered {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.palette-btn.review {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.palette-btn.current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.3);
}

/* Result Section */
.result-container {
    background: var(--bg-secondary);
    max-width: 800px;
    margin: 2rem auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.result-header {
    background: linear-gradient(135deg, var(--success-color) 0%, #047857 100%);
    color: white;
    padding: 2.5rem 2rem;
    text-align: center;
}

.result-header i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.result-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.result-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.result-card p {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.score-card {
    text-align: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #93c5fd;
}

.score-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.score-total {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.score-percentage {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--success-color);
}

.section-wise-score {
    padding: 0 2rem 2rem;
}

.section-wise-score h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.section-scores {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-score-item {
    display: flex;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.result-actions {
    padding: 1.5rem 2rem;
    background: var(--bg-primary);
    text-align: center;
}

/* Admin Dashboard */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h2 {
    color: var(--primary-color);
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.3s ease;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
}

.admin-stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.admin-stat-card h3 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.admin-stat-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-content {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.admin-content h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.results-table-container {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.results-table thead {
    background: var(--bg-primary);
}

.results-table th {
    padding: 0.875rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.results-table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.results-table tbody tr:hover {
    background: var(--bg-primary);
}

.no-data {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 968px) {
    .assessment-body {
        grid-template-columns: 1fr;
    }
    
    .question-palette {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .brand-subtitle {
        margin-left: 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .auth-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .instructions-actions {
        flex-direction: column;
    }
    
    .instructions-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .assessment-top-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .section-tabs {
        justify-content: center;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .question-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .question-navigation button {
        width: 100%;
        justify-content: center;
    }
    
    .result-summary {
        grid-template-columns: 1fr;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   Exam Security / Anti Tab-Switching
   ============================================================ */

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857 !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}

body.security-locked {
    overflow: hidden;
}

/* Disabled header navigation while an assessment is running */
.nav-btn:disabled,
.nav-btn.nav-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.security-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.88);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.security-overlay.show {
    display: flex;
    animation: securityFadeIn 0.2s ease-out;
}

.security-modal {
    width: 100%;
    max-width: 560px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border-top: 6px solid var(--accent-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    padding: 2.25rem 2rem;
    text-align: center;
    animation: securityPopIn 0.25s ease-out;
}

.security-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: var(--accent-color);
    font-size: 2.25rem;
    animation: securityPulse 1.4s ease-in-out infinite;
}

.security-modal h2 {
    color: var(--accent-color);
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.security-message {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.security-reason {
    display: inline-block;
    margin-bottom: 1.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: capitalize;
}

.security-countdown {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.security-countdown-number {
    flex-shrink: 0;
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-color);
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.security-countdown-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.security-countdown-text strong {
    color: #9a3412;
    font-size: 0.95rem;
}

.security-countdown-text span {
    color: var(--text-light);
    font-size: 0.85rem;
}

.security-submit-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: var(--accent-color);
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.security-submit-btn:hover {
    background: #b91c1c;
}

.security-note {
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 0.78rem;
}

/* Pre-exam caution (shown before the timer starts) */
.pre-exam-modal {
    max-width: 600px;
}

.pre-exam-icon {
    background: #e0f2fe;
    color: var(--primary-color);
    font-size: 2rem;
    animation: none;
}

.pre-exam-rules {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    text-align: left;
    display: grid;
    gap: 0.6rem;
}

.pre-exam-rules li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pre-exam-rules li i {
    color: var(--primary-color);
    margin-top: 0.15rem;
}

.pre-exam-cancel {
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.pre-exam-cancel:hover {
    background: var(--bg-primary);
}

/* Early warning when the pointer heads towards the browser tab bar */
.leave-warning {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 9500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: calc(100vw - 2rem);
    padding: 0.75rem 1.25rem;
    border: 1px solid #fcd34d;
    border-top: none;
    border-radius: 0 0 12px 12px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    transform: translate(-50%, -110%);
    transition: transform 0.25s ease;
    pointer-events: none;
}

.leave-warning.show {
    transform: translate(-50%, 0);
}

.result-notice {
    display: none;
    margin: 1.25rem auto 0;
    max-width: 560px;
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
}

.result-notice.show {
    display: block;
}

@keyframes securityFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes securityPopIn {
    from { opacity: 0; transform: scale(0.94) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes securityPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35); }
    50% { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); }
}

@media (max-width: 480px) {
    .security-modal {
        padding: 1.75rem 1.25rem;
    }

    .security-modal h2 {
        font-size: 1.3rem;
    }

    .security-countdown {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================
   Result review, admin answer sheet and CSV export
   ============================================================ */
.score-caption {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.score-note {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.answer-review {
    padding: 0 2rem 2rem;
}

.answer-review > h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.review-block {
    margin-bottom: 1.75rem;
}

.review-block h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.review-block h4 span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
}

.review-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
    min-width: 720px;
}

.review-table th {
    background: var(--bg-primary);
    color: var(--primary-color);
    text-align: left;
    font-weight: 600;
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.review-table td {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    color: var(--text-secondary);
}

.review-table tbody tr:last-child td {
    border-bottom: none;
}

.review-question {
    min-width: 220px;
    color: var(--text-primary);
}

.review-marks {
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-primary);
}

.row-correct {
    background: #f0fdf4;
}

.row-wrong {
    background: #fef2f2;
}

.row-skip {
    background: #f8fafc;
}

.answer-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.answer-badge.correct {
    background: #dcfce7;
    color: #166534;
}

.answer-badge.wrong {
    background: #fee2e2;
    color: #991b1b;
}

.answer-badge.skip {
    background: #e2e8f0;
    color: #475569;
}

.answer-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.answer-text {
    margin: 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.78rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 180px;
    overflow: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    color: var(--text-primary);
}

.muted {
    color: var(--text-light);
}

.admin-content-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.admin-content-head h3 {
    margin-bottom: 0;
}

.admin-content-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-content-actions .btn-secondary {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
}

.view-btn {
    padding: 0.3rem 0.7rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
}

.view-btn:hover {
    background: var(--primary-dark);
}

.status-done {
    color: var(--success-color);
    font-weight: 600;
    white-space: nowrap;
}

.status-auto {
    color: var(--warning-color);
    font-weight: 600;
    white-space: nowrap;
}

.admin-storage-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.candidate-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 400;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.candidate-modal.show {
    display: block;
}

.candidate-modal-box {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.candidate-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: #fff;
}

.candidate-modal-head h3 {
    font-size: 1.1rem;
    margin: 0;
}

.candidate-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.candidate-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.candidate-modal-body {
    padding: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
}

.candidate-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.candidate-summary div {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.candidate-summary span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
}

.candidate-summary strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

body.modal-open {
    overflow: hidden;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .section-wise-score,
    .answer-review {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .candidate-modal-body {
        padding: 1rem;
        max-height: 80vh;
    }
}
