:root {
    --primary-color: #2563eb;
    /* Royal Blue */
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    /* Slate */
    --background-color: #f1f5f9;
    /* Slate-100 */
    --card-bg: #ffffff;
    --text-main: #1e293b;
    /* Slate-800 */
    --text-muted: #64748b;
    /* Slate-500 */
    --border-color: #cbd5e1;
    /* Slate-300 */
    --focus-ring: rgba(37, 99, 235, 0.4);
    --error-color: #ef4444;
    --radius: 8px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Responsive Table Wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

body {
    font-family: 'Roboto', 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-main);
    margin: 0;
    line-height: 1.5;
}

.form-page-body {
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    width: 100%;
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--background-color);
    padding-bottom: 1.5rem;
}

.logo {
    max-width: 120px;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

h1 {
    color: var(--text-main);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

/* Form Layout */
fieldset {
    border: none;
    background-color: #f8fafc;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--background-color);
}

legend {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0 0.5rem;
    background-color: var(--card-bg);
    /* Mask border */
    border-radius: 4px;
}

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

.form-group-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

/* Inputs */
input[type="text"],
input[type="date"],
input[type="tel"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

input:disabled {
    background-color: #e2e8f0;
    cursor: not-allowed;
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.25rem;
}

.radio-group label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

input[type="radio"] {
    width: 1.1em;
    height: 1.1em;
    accent-color: var(--primary-color);
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 400;
}

.checkbox-item:hover {
    background-color: #f1f5f9;
}

.checkbox-item:has(input:checked) {
    background-color: #eff6ff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

input[type="checkbox"] {
    width: 1.1em;
    height: 1.1em;
    accent-color: var(--primary-color);
}

/* Buttons */
.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--background-color);
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-submit {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-submit:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background-color: #94a3b8;
    cursor: wait;
    transform: none;
}

.btn-reset {
    background-color: white;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-reset:hover {
    background-color: #f8fafc;
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* Toast Notification (Hidden by default) */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #10b981;
    /* Emerald-500 */
}

.toast.error {
    background-color: #ef4444;
    /* Red-500 */
}

/* Mobile Optimization */
@media (max-width: 640px) {
    body {
        padding: 0.5rem;
    }

    .container {
        padding: 1.5rem;
    }

    .form-group-inline {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .form-buttons {
        flex-direction: column-reverse;
    }

    button {
        width: 100%;
    }

    h1 {
        font-size: 1.5rem;
    }
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.big-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    text-align: center;
}

.big-btn:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.big-btn .icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.big-btn:hover .icon {
    transform: scale(1.1);
}

.big-btn h2 {
    margin: 0 0 0.75rem 0;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.big-btn p {
    color: var(--text-muted);
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
}

/* Modern, Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-title {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-message {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.modal-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-btn:hover {
    background-color: var(--primary-hover);
}

.checkmark-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: block;
    background: #10b981;
    margin: 0 auto 15px;
    position: relative;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.checkmark {
    position: absolute;
    transform: rotate(45deg) translate(-50%, -50%);
    top: 45%;
    left: 25%;
    height: 30px;
    width: 15px;
    border-bottom: 4px solid white;
    border-right: 4px solid white;
}

/* --- Global Loading Spinner --- */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.global-loader.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e2e8f0;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Helper */
.hidden {
    display: none !important;
}

/* =========================================
   A4 SHEET SIMULATION & PRINT STYLES
   ========================================= */

/* =========================================
   CBSE-STYLE WEB RESULT
   ========================================= */

.result-web-container {
    /* Full Page Web Result */
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    background: white;
    margin: 0;
    padding: 2rem;
    box-shadow: none;
    border: none;
    position: relative;
    overflow: hidden;
    color: #000;
    font-family: 'Arial', sans-serif;
}

.watermark-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 50%;
    background-image: url('logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
    position: fixed;
    /* Fixed so it stays centered on scroll */
}

.sheet-content {
    position: relative;
    z-index: 1;
}

/* Header Re-styling */
.sheet-header {
    text-align: center;
    margin-bottom: 5mm;
    border-bottom: 2px solid #333;
    padding-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-direction: column;
    /* Stack vertically for simpler look */
}

.sheet-logo {
    width: 100px;
    height: auto;
}

.header-text h1 {
    font-size: 2rem;
    font-weight: 900;
    margin: 0;
    color: #b91c1c;
    text-transform: uppercase;
    letter-spacing: normal;
    font-family: 'Arial', sans-serif;
}

.header-text p {
    margin: 2px 0;
    font-size: 11pt;
    font-weight: 500;
}

/* Exam Title */
.exam-title-box {
    text-align: center;
    margin: 5mm 0;
}

.exam-title-box h2 {
    font-size: 16pt;
    font-weight: bold;
    text-decoration: underline;
    text-transform: uppercase;
    margin: 0;
}

/* Student Details - More Compact */
.student-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 11pt;
    border: none;
    /* Remove box border for cleaner look */
    padding: 0;
}

.detail-row {
    display: flex;
}

.detail-row .label {
    font-weight: bold;
    width: 130px;
}

.detail-row .value {
    font-weight: 600;
    border-bottom: 1px solid #ccc;
    /* Solid line instead of dotted */
    flex: 1;
}

/* Table - Web Standard */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 5mm;
    font-size: 10pt;
    font-family: 'Arial', sans-serif;
}

.report-table th,
.report-table td {
    border: 1px solid #000;
    padding: 6px 10px;
    text-align: center;
}

.report-table th {
    background-color: #333;
    font-weight: normal;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.5px;
}

.report-table td[style*="text-align: left"] {
    text-align: left;
    padding-left: 15px;
}

/* Summary Box */
.result-summary-box {
    display: flex;
    justify-content: space-between;
    border: 2px solid #000;
    background: #f9fafb;
    margin-bottom: 10mm;
}

.summary-item {
    flex: 1;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-item span {
    font-size: 10pt;
    text-transform: uppercase;
    color: #555;
}

.summary-item strong {
    font-size: 14pt;
    font-weight: bold;
}

/* Signatures */
.signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 15mm;
    padding: 0 10mm;
}

.sig-block {
    text-align: center;
    width: 200px;
}

.sig-block .line {
    border-bottom: 1px solid #000;
    margin-bottom: 5px;
    height: 1px;
}

.footer-note {
    position: absolute;
    bottom: 5mm;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 9pt;
    font-style: italic;
    color: #666;
}

/* Result Fee Lock Message */
.fee-lock-msg {
    background: #fee2e2;
    color: #991b1b;
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #ef4444;
    margin: 2rem auto;
    max-width: 600px;
    display: none;
    /* KEY FIX: Hidden by default */
}

/* Print Overrides */
@media print {
    body * {
        visibility: hidden;
    }

    .a4-sheet,
    .a4-sheet * {
        visibility: visible;
    }

    .a4-sheet {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
        box-shadow: none;
        width: 100%;
    }

    .btn-submit,
    .form-header,
    .search-area,
    .fee-lock-msg,
    .no-print {
        display: none !important;
    }
}

/* =========================================
   MODERN DASHBOARD STYLES (New Result View)
   ========================================= */

.bg-slate-50 {
    background-color: #f8fafc;
}

.text-center {
    text-align: center;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    height: 40px;
    width: auto;
}

.nav-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: #1e293b;
}

/* Back Button */
.btn-back {
    background: none;
    border: none;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-back:hover {
    color: #1e293b;
    text-decoration: underline;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Badge */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.exam-title {
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.exam-subtitle {
    color: #64748b;
    margin: 0;
}

.status-badge {
    padding: 0.5rem 1.5rem;
    border-radius: 99px;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    background: #dcfce7;
    color: #166534;
    /* Success Green Default */
}

.status-badge.fail {
    background: #fee2e2;
    color: #991b1b;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-weight: 900;
    opacity: 0.2;
    font-size: 1.5rem;
}

/* Split Layout */
.content-split {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .content-split {
        grid-template-columns: 1fr;
    }
}

/* Student Profile Card */
.student-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 2rem;
    text-align: center;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    background: #eff6ff;
    color: #3b82f6;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.student-name {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
}

.profile-details {
    text-align: left;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-row span {
    color: #64748b;
    font-size: 0.9rem;
}

.profile-row strong {
    color: #334155;
    font-size: 0.95rem;
}

/* Table Section */
.marks-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.card-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #334155;
}

.web-table {
    width: 100%;
    border-collapse: collapse;
}

.web-table th {
    background: #f8fafc;
    text-align: left;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.web-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-weight: 500;
}

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

.web-table .text-center {
    text-align: center;
}

/* Status Row Colors */
.row-fail {
    background-color: #fef2f2 !important;
}

.text-fail {
    color: #dc2626 !important;
    font-weight: 600;
}

/* States */
.center-state {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.error-icon,
.lock-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-outline {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
}

.btn-outline:hover {
    background: #f8fafc;
}

/* =========================================
   MINIMAL SCAN LAYOUT (Fluid, Clean)
   ========================================= */

.minimal-scan-body {
    background: #fff;
    margin: 0;
    padding: 20px;
    font-family: 'Arial', sans-serif;
    color: #000;
}

.scan-container {
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.scan-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 50%;
    background: url('logo.png') no-repeat center center;
    background-size: contain;
    opacity: 0.1;
    /* Slightly increased for visibility as per "receipt like" */
    z-index: 0;
    pointer-events: none;
}

.scan-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.scan-logo {
    height: 80px;
    width: auto;
    margin-bottom: 10px;
}

.scan-org-info h1 {
    font-size: 24px;
    margin: 0;
    color: #b91c1c;
    text-transform: uppercase;
    font-weight: 900;
}

.scan-org-info p {
    margin: 5px 0;
    font-size: 14px;
}

.scan-exam-title {
    font-weight: bold;
    text-decoration: underline;
    font-size: 18px;
    margin-top: 10px !important;
}

.scan-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    font-size: 16px;
}

.scan-row {
    display: flex;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 5px;
}

.scan-label {
    font-weight: bold;
    width: 150px;
}

.scan-value {
    font-weight: 500;
    text-transform: uppercase;
}

.scan-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 15px;
}

.scan-table th,
.scan-table td {
    border: 1px solid #000;
    padding: 10px;
    text-align: center;
}

.scan-table th {
    background-color: #f3f3f3;
    font-weight: bold;
}

.scan-summary {
    text-align: right;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.8;
}

.scan-actions {
    text-align: center;
    margin-top: 40px;
    font-size: 12px;
}

.scan-actions a {
    color: #666;
    text-decoration: none;
}



/* =========================================
   HOMEPAGE STYLES (index.html)
   ========================================= */

:root {
    --primary: #1A1A1A;
    --secondary: #982B1C;
    --light: #F2E8C6;
    --bg-white: #ffffff;
    --text-dark: #333;
    --text-light: #f5f5f5;
}

/* Header */
header {
    background-color: var(--primary);
    color: white;
    padding: 1rem 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
}

.header-logo img {
    width: 140px;
    height: 140px;
    padding: 2px;
}

/* Center the School Name */
.header-logo span {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
}

nav.nav-main {
    display: flex;
    gap: 2rem;
}

nav.nav-main a {
    color: var(--light);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
}

nav.nav-main a:hover {
    color: white;
    text-decoration: underline;
}

/* ERP Nav Button */
nav.nav-main a.nav-erp {
    background-color: var(--secondary);
    padding: 8px 18px;
    border-radius: 20px;
    color: white;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

nav.nav-main a.nav-erp:hover {
    background-color: #b93623;
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://i.postimg.cc/r003j2sr/Whats-App-(3).webp');
    background-size: cover;
    background-position: center;
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 20px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}



/* Sections */
.section {
    padding: 80px 10%;
    text-align: center;
}

.section h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
}

.section h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--secondary);
    margin: 10px auto 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
    border-bottom: 5px solid var(--secondary);
}

.card:hover {
    transform: translateY(-10px);
}

.card h4 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.card p {
    color: #666;
    line-height: 1.6;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    aspect-ratio: 4/3;
    /* Maintain consistent aspect ratio */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Reviews Section */
.reviews {
    background: var(--light);
}

.reviews .card {
    border-bottom: 5px solid var(--primary);
    /* Different accent color */
    text-align: left;
}

.reviews h4 {
    color: var(--primary);
    margin-bottom: 5px;
}

.reviews .role {
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reviews p:last-child {
    font-style: italic;
    color: #555;
    font-size: 1.05rem;
}

.quick-links .card a {
    color: white;
    text-decoration: none;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.facility-item {
    padding: 2rem;
    border-radius: 20px;
    background: white;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.facility-item:hover {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03);
}

.facility-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.facility-item h4 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.facility-item p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* Stats Section */
.stats-bar {
    background: var(--dark-accent);
    color: white;
    padding: 4rem 10%;
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* Footer */
footer {
    background: var(--primary);
    color: white;
    padding: 30px 40px;
    text-align: center;
    border-top: 5px solid var(--secondary);
}

footer p {
    margin: 5px 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: var(--light);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
    }

    nav.nav-main {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero {
        height: auto;
        min-height: 60vh;
        padding: 4rem 1rem;
    }

    .section {
        padding: 40px 20px;
    }

    .cards {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   PEARL BUTTON (From User)
   ========================================= */
.btn-pearl {
    --white: #ffe7ff;
    --bg: var(--primary);
    /* Adapted to theme */
    --radius: 100px;
    outline: none;
    cursor: pointer;
    border: 0;
    position: relative;
    border-radius: var(--radius);
    background-color: var(--bg);
    transition: all 0.2s ease;
    box-shadow:
        inset 0 0.3rem 0.9rem rgba(255, 255, 255, 0.3),
        inset 0 -0.1rem 0.3rem rgba(0, 0, 0, 0.7),
        inset 0 -0.4rem 0.9rem rgba(255, 255, 255, 0.5),
        0 3rem 3rem rgba(0, 0, 0, 0.3),
        0 1rem 1rem -0.6rem rgba(0, 0, 0, 0.8);
    font-family: inherit;
    /* Ensure font matches */
}

.btn-pearl .wrap {
    font-size: 1.2rem;
    /* Adjusted size */
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    padding: 15px 40px;
    /* Adjusted padding */
    border-radius: inherit;
    position: relative;
    overflow: hidden;
}

.btn-pearl .wrap p span:nth-child(2) {
    display: none;
}

.btn-pearl:hover .wrap p span:nth-child(1) {
    display: none;
}

.btn-pearl:hover .wrap p span:nth-child(2) {
    display: inline-block;
}

.btn-pearl .wrap p {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    transition: all 0.2s ease;
    transform: translateY(2%);
    mask-image: linear-gradient(to bottom, white 40%, transparent);
}

.btn-pearl .wrap::before,
.btn-pearl .wrap::after {
    content: "";
    position: absolute;
    transition: all 0.3s ease;
}

.btn-pearl .wrap::before {
    left: -15%;
    right: -15%;
    bottom: 25%;
    top: -100%;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.12);
}

.btn-pearl .wrap::after {
    left: 6%;
    right: 6%;
    top: 12%;
    bottom: 40%;
    border-radius: 22px 22px 0 0;
    box-shadow: inset 0 10px 8px -10px rgba(255, 255, 255, 0.8);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(0, 0, 0, 0) 50%,
            rgba(0, 0, 0, 0) 100%);
}

.btn-pearl:hover {
    box-shadow:
        inset 0 0.3rem 0.5rem rgba(255, 255, 255, 0.4),
        inset 0 -0.1rem 0.3rem rgba(0, 0, 0, 0.7),
        inset 0 -0.4rem 0.9rem rgba(255, 255, 255, 0.7),
        0 3rem 3rem rgba(0, 0, 0, 0.3),
        0 1rem 1rem -0.6rem rgba(0, 0, 0, 0.8);
}

.btn-pearl:hover .wrap::before {
    transform: translateY(-5%);
}

.btn-pearl:hover .wrap::after {
    opacity: 0.4;
    transform: translateY(5%);
}

.btn-pearl:hover .wrap p {
    transform: translateY(-4%);
}

.btn-pearl:active {
    transform: translateY(4px);
    box-shadow:
        inset 0 0.3rem 0.5rem rgba(255, 255, 255, 0.5),
        inset 0 -0.1rem 0.3rem rgba(0, 0, 0, 0.8),
        inset 0 -0.4rem 0.9rem rgba(255, 255, 255, 0.4),
        0 3rem 3rem rgba(0, 0, 0, 0.3),
        0 1rem 1rem -0.6rem rgba(0, 0, 0, 0.8);
}

/* =========================================
   LOGIN PAGE STYLES (mang_login.html & students_login.html)
   ========================================= */

.login-body {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    margin: 0;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
}

.logo-container {
    margin-bottom: 2rem;
}

.logo-img {
    width: 100px;
    height: auto;
    margin-bottom: 1rem;
}

.login-title {
    color: #1e293b;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1e293b;
    font-weight: 500;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    margin-top: 1rem;
}

.btn-login:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.btn-login:disabled {
    background-color: #94a3b8;
    cursor: wait;
}


/* =========================================
   FEE PAGE STYLES (fee.html)
   ========================================= */

.header-subtitle {
    color: #64748b;
    margin-top: 0.5rem;
}

.fee-divider {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #cbd5e1;
}

.total-group {
    text-align: right;
}

.total-label {
    font-size: 1.2rem;
}

.total-value {
    color: #2563eb;
}

.pending-box {
    display: none;
    background-color: #fff4f4;
    padding: 10px;
    border-radius: 5px;
    border: 1px dashed red;
    margin-top: 10px;
}


/* =========================================
   RESULT VIEW STYLES (results_view.html)
   ========================================= */

.btn-back-header {
    float: left;
    font-size: 0.8rem;
}

.text-sub {
    color: #64748b;
}

.align-end {
    align-items: flex-end;
}

.flex-1 {
    flex: 1;
}

.btn-search-submit {
    margin-bottom: 0.5rem;
    height: 46px;
}

/* =========================================
   ANNOUNCEMENTS SECTION
   ========================================= */
.announcements {
    background-color: #f8fafc;
    /* Light gray to distinguish from white hero/gallery */
}

.announcement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Responsive */
    gap: 2rem;
    margin-top: 2rem;
    padding: 0 1rem;
}

.notice-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: left;
    /* Override .section center */
    position: relative;
    overflow: hidden;
}

.notice-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

.notice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.notice-date {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.notice-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.badge-event {
    background-color: #dbeafe;
    color: #1e40af;
}

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

.badge-admission {
    background-color: #d1fae5;
    color: #065f46;
}

.notice-text {
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-read-more {
    align-self: flex-start;
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    /* Reset generic button width */
}

.btn-read-more:hover {
    background: #2563eb;
    color: white;
}