/*
=========================================================
style.css - Main Stylesheet for Survey Form
Graduate Specialty Transfer Survey System
Syrian Ministry of Higher Education and Scientific Research

Developed by: Dr. Eng. Yasser KHADRA
Year: 2026
Version: 8.6 - Enhanced UI Design (Integrated Status + Bottom Nav)
=========================================================
*/

/* ========================================================= */
/* Reset & Base Styles */
/* ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-brand);
    background: var(--surface);
    color: var(--text);
    direction: rtl;
    padding: 24px 20px;
    padding-bottom: 80px;
}

:root {
    --mohe-blue: #002623;
    --mohe-blue-dark: #002623;
    --mohe-blue-light: #EEEADF;
    --mohe-gold: #B8A678;
    --mohe-gold-dark: #B8A678;
    --mohe-gold-light: #EEEADF;
    --warning-red: #6C1E2B;
    --warning-red-light: #EEEADF;
    --success-green: #427F77;
    --success-green-light: #EEEADF;
    --neutral-white: #FFFFFF;
    --neutral-gray-50: #FFFFFF;
    --neutral-gray-100: #EEEADF;
    --neutral-gray-200: #3C3A3B;
    --neutral-gray-300: #3C3A3B;
    --neutral-gray-500: #3C3A3B;
    --neutral-gray-700: #3C3A3B;
    --neutral-dark: #002623;
    --neutral-black: #002623;
    --shadow-sm: 0 2px 8px rgba(0, 38, 35, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 38, 35, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 38, 35, 0.15);
    --shadow-gold: 0 0 0 3px rgba(184, 166, 120, 0.2);
    --shadow-warning: 0 0 0 3px rgba(108, 30, 43, 0.2);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================================= */
/* Page Transitions */
/* ========================================================= */

.page {
    display: none;
}

.page.active {
    display: block;
    animation: pageFadeIn 0.3s ease;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================================= */
/* Official Header */
/* ========================================================= */

.official-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    margin-bottom: 25px;
    background: var(--surface);
    padding: 15px 25px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--golden-wheat);
    transition: all 0.3s ease;
}

.official-header:hover {
    box-shadow: var(--shadow-md);
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin: 5px 0 3px;
    letter-spacing: -0.3px;
}

/* ========================================================= */
/* Survey Header with Status */
/* ========================================================= */

.survey-header-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line-soft);
    transition: all 0.3s ease;
}

.survey-header-container:hover {
    box-shadow: var(--shadow-md);
}

.survey-title-wrapper {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px dashed var(--line-soft);
}

.survey-main-title {
    font-size: clamp(1.1rem, 3vw, 1.8rem);
    font-weight: 800;
    color: var(--text);
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.survey-main-title i {
    color: var(--golden-wheat);
}

.survey-sub-title {
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

/* ========================================================= */
/* Survey Status Banner (Hidden - Integrated with top bar) */
/* ========================================================= */

.survey-status-banner {
    display: none;
}

/* ========================================================= */
/* Top Progress Bar - INTEGRATED WITH STATUS */
/* ========================================================= */

.page-progress-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    padding: 12px 20px;
    border-radius: 50px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line-soft);
    flex-wrap: wrap;
    gap: 10px;
}

/* حالة الاستبيان في الشريط العلوي */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.status-indicator .icon {
    font-size: 1.2rem;
}

.status-indicator .text {
    font-weight: 700;
    font-size: 0.8rem;
}

.status-indicator .text.open {
    color: var(--text-info);
}

.status-indicator .text.closed {
    color: var(--text-danger);
}

.status-indicator .countdown {
    font-size: 0.65rem;
    color: var(--text-soft);
}

/* دوائر الصفحات */
.page-progress-steps {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid var(--line-strong);
    position: relative;
}

.step .step-number {
    display: inline;
}

.step:hover:not(.active):not(.completed):not(.disabled):not(.locked):not(.ready):not(.error) {
    border-color: var(--golden-wheat);
    color: var(--text);
    transform: scale(1.05);
}

/* ======================================== */
/* حالات دوائر الصفحات الست */
/* ======================================== */

/* الحالة 1: الصفحة الحالية - غير مكتملة (برتقالي) */
.step.active {
    background: #B8A678;
    color: white;
    box-shadow: 0 0 0 3px rgba(184, 166, 120, 0.3);
    border-color: #B8A678;
}

/* الحالة 2: الصفحة الحالية - مكتملة جاهزة (ذهبي) */
.step.ready {
    background: var(--golden-wheat);
    color: white;
    box-shadow: 0 0 0 3px rgba(184, 166, 120, 0.3);
    border-color: var(--golden-wheat);
    animation: pulseGold 1.5s ease-in-out infinite;
}

@keyframes pulseGold {
    0%, 100% { box-shadow: 0 0 0 3px rgba(184, 166, 120, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(184, 166, 120, 0.1); }
}

/* الحالة 3: الصفحة مكتملة وتم تجاوزها (أخضر مع ✓) */
.step.completed {
    background: var(--mountain-teal);
    color: white;
    position: relative;
    border-color: var(--mountain-teal);
}

.step.completed .step-number {
    display: none;
}

.step.completed::after {
    content: "✓";
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

/* الحالة 4: الصفحة فيها أخطاء (أحمر) */
.step.error {
    background: var(--damask-red);
    color: white;
    border-color: var(--damask-red);
    box-shadow: 0 0 0 3px rgba(108, 30, 43, 0.4);
    animation: shakeError 0.5s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* الحالة 5: الصفحة مقفلة لم تفتح بعد (رمادي غامق مع قفل) */
.step.locked {
    background: #3C3A3B !important;
    color: #3C3A3B !important;
    border-color: #3C3A3B !important;
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.step.locked .step-number {
    display: none;
}

.step.locked::after {
    content: "🔒" !important;
    font-size: 0.6rem;
}

/* الحالة 6: الصفحة يمكن الوصول إليها (رمادي فاتح) */
.step.available {
    background: var(--surface);
    color: var(--text);
    border-color: var(--golden-wheat);
    cursor: pointer;
}

.step.available:hover {
    background: var(--surface-soft);
    border-color: var(--golden-wheat);
    transform: scale(1.05);
}

/* الحالة القديمة disabled - نحتفظ بها للتوافق */
.step.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--surface-soft);
    color: var(--text-soft);
    border-color: var(--line-strong);
}

/* أزرار الإجراءات في الشريط العلوي */
.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-progress-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-family: var(--font-brand);
    position: relative;
}

.btn-progress-action:hover:not(:disabled) {
    transform: scale(1.1);
    border-color: var(--golden-wheat);
    color: var(--text);
    box-shadow: var(--shadow-gold);
}

.btn-progress-action:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

.countdown-prefix {
    font-weight: 700;
    color: var(--text);
}

.countdown-value {
    font-weight: 700;
    color: hsl(168, 93%, 17%);
    /*font-family: monospace;*/
}

.countdown-label {
    font-weight: 700;
    color: var(--text);
}

/* رقم الصفحة في الشريط العلوي */
.page-progress-text {
    font-size: 0.75rem;
    color: var(--text);
    font-weight: 700;
    background: var(--surface-soft);
    padding: 4px 12px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ========================================================= */
/* Bottom Navigation Bar - ENHANCED */
/* ========================================================= */

.bottom-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--surface);
    border-radius: 60px;
    margin-top: 25px;
    box-shadow: 0 4px 16px rgba(0, 38, 35, 0.10);
    border: 1px solid var(--line-soft);
    transition: all 0.3s ease;
}

.bottom-nav-bar:hover {
    box-shadow: 0 6px 24px rgba(0, 38, 35, 0.15);
}

/* أزرار التنقل */
.btn-nav {
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
    font-family: var(--font-brand);
}

.btn-nav i {
    font-size: 0.9rem;
}

/* زر السابق */
.btn-nav.btn-prev {
    background: var(--surface-soft);
    color: var(--text-soft);
}

.btn-nav.btn-prev:hover:not(:disabled) {
    background: var(--stone);
    transform: translateX(-2px);
}

.btn-nav.btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* زر التالي */
.btn-nav.btn-next {
    background: var(--forest);
    color: white;
}

.btn-nav.btn-next:hover:not(:disabled) {
    background: var(--forest);
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.btn-nav.btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* زر بدء الاستبيان */
.btn-nav.btn-start {
    background: linear-gradient(135deg, var(--golden-wheat), var(--golden-wheat));
    color: white;
    box-shadow: 0 4px 12px rgba(184, 166, 120, 0.3);
    min-width: 140px;
}

.btn-nav.btn-start:hover:not(:disabled) {
    transform: translateX(2px);
    box-shadow: 0 6px 20px rgba(184, 166, 120, 0.4);
    background: linear-gradient(135deg, var(--golden-wheat), var(--golden-wheat));
}

.btn-nav.btn-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* زر تجهيز التقرير */
.btn-nav.btn-review {
    background: linear-gradient(135deg, var(--mountain-teal), #094239);
    color: white;
    box-shadow: 0 4px 12px rgba(66, 127, 119, 0.3);
    min-width: 160px;
}

.btn-nav.btn-review:hover:not(:disabled) {
    transform: translateX(2px);
    box-shadow: 0 6px 20px rgba(66, 127, 119, 0.4);
    background: linear-gradient(135deg, #094239, #094239);
}

.btn-nav.btn-review:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* مؤشر الصفحة */
.page-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-soft);
    padding: 6px 18px;
    border-radius: 30px;
}

.page-indicator i {
    color: var(--golden-wheat);
    font-size: 0.8rem;
}

.page-indicator span {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text);
}

/* دوائر التنقل المخفية (للتوافق مع app.js) */
.nav-dots {
    display: none;
}

/* ========================================================= */
/* Form Cards */
/* ========================================================= */

.announce-card {
    background: linear-gradient(135deg, var(--mohe-beige) 0%, var(--white) 100%);
    border: 1px solid var(--ivory-mist);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border-right: 5px solid var(--golden-wheat);
}

.announce-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.announce-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    border-right: 4px solid var(--golden-wheat);
    padding-right: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-card {
    background: linear-gradient(135deg, var(--surface-soft) 0%, var(--surface) 100%);
    border-right: 5px solid var(--damask-red);
}

.warning-card .announce-title {
    color: var(--text-danger) !important;
    border-right-color: var(--damask-red) !important;
}

.info-card {
    background: linear-gradient(135deg, var(--surface-soft) 0%, var(--surface) 100%);
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 20px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.form-card:hover {
    box-shadow: var(--shadow-md);
}

/* ========================================================= */
/* Form Sections */
/* ========================================================= */

.form-section {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 20px;
}

.form-section h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    border-right: 4px solid var(--golden-wheat);
    padding-right: 12px;
}

.form-section h3 i {
    color: var(--golden-wheat);
    font-size: 1.1rem;
}

.form-section h4 {
    font-size: 1rem;
    color: var(--text);
    margin: 15px 0 12px 0;
    padding-right: 10px;
    border-right: 3px solid var(--golden-wheat);
}

/* ========================================================= */
/* Form Grid */
/* ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

/* ========================================================= */
/* Input Fields */
/* ========================================================= */

.input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-field label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-field label i {
    color: var(--golden-wheat);
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.input-field.required label::after {
    content: " *";
    color: var(--text-danger);
    font-weight: bold;
}

.input-field input:required,
.input-field select:required,
.input-field textarea:required {
    border-right: 2px solid var(--damask-red);
}

.input-field input,
.input-field select,
.input-field textarea {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: var(--font-brand);
    font-size: 0.85rem;
    color: var(--text);
    transition: all 0.2s ease;
    outline: none;
}

.input-field input:hover,
.input-field select:hover,
.input-field textarea:hover {
    border-color: var(--golden-wheat);
    background: var(--surface);
}

.input-field input:focus,
.input-field select:focus,
.input-field textarea:focus {
    border-color: var(--edge);
    box-shadow: var(--shadow-gold);
    background: var(--surface);
}

/* ========================================================= */
/* Incomplete Fields */
/* ========================================================= */

.input-field.incomplete input,
.input-field.incomplete select,
.input-field.incomplete textarea {
    background-color: var(--surface-soft);
    border-color: var(--damask-red);
    border-right: 2px solid var(--damask-red);
}

.input-field.incomplete label {
    color: var(--text-danger);
}

.input-field.incomplete label i {
    color: var(--text-danger);
}

/* A field explicitly selected by the reviewer: it must stand out from normal
   required fields and provides a direct, keyboard-accessible edit action. */
.input-field.correction-required {
    padding: 9px;
    border: 1px solid var(--damask-red);
    border-radius: 12px;
    background: var(--surface-soft);
}

.input-field.correction-required label,
.input-field.correction-required label i {
    color: var(--text-danger);
}

.input-field.correction-required input,
.input-field.correction-required select,
.input-field.correction-required textarea {
    border-color: var(--damask-red);
    background: var(--surface);
    box-shadow: 0 0 0 2px rgba(108, 30, 43, 0.12);
}

.correction-edit-action {
    align-self: flex-start;
    margin-top: 2px;
    padding: 5px 10px;
    border: 0;
    border-radius: 7px;
    background: var(--damask-red);
    color: #fff;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.correction-edit-action:hover,
.correction-edit-action:focus-visible {
    background: #6C1E2B;
    outline: 3px solid rgba(108, 30, 43, 0.2);
    outline-offset: 2px;
}

/* A dependent field is opened so the final values can remain consistent. It
   is not a reviewer-mandated edit unless its current value becomes invalid. */
.input-field.correction-dependent {
    padding: 8px;
    border: 1px dashed #978362;
    border-radius: 12px;
    background: var(--surface);
}

/* ========================================================= */
/* Readonly Fields */
/* ========================================================= */

.readonly-field {
    background: var(--surface-soft) !important;
    font-weight: 700;
    color: var(--text) !important;
    border-color: var(--edge) !important;
}

/* ========================================================= */
/* Hints */
/* ========================================================= */

.inline-hint {
    font-size: 0.65rem;
    color: var(--text-soft);
    margin-top: 3px;
    transition: all 0.2s ease;
}

/* Temporary development controls; remove before production release. */
.test-fill-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 14px auto;
    padding: 7px 12px;
    border: 1px dashed #B8A678;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.test-fill-btn:hover {
    background: #B8A678;
    color: #FFFFFF;
    transform: translateY(-1px);
}

.test-fill-btn:focus-visible {
    outline: 3px solid rgba(184, 166, 120, 0.3);
    outline-offset: 2px;
}

/* ========================================================= */
/* File Upload Actions */
/* ========================================================= */

.input-field input[type="file"] {
    width: 100%;
    padding: 7px;
    border: 1px dashed var(--line-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.input-field input[type="file"]:hover,
.input-field input[type="file"]:focus {
    border-color: var(--edge);
    background: var(--surface-soft);
    box-shadow: 0 0 0 3px rgba(0, 38, 35, 0.08);
    outline: none;
}

.input-field input[type="file"]::file-selector-button {
    margin-left: 9px;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: var(--forest);
    color: #FFFFFF;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    transition: background 0.2s ease;
}

.input-field input[type="file"]::file-selector-button:hover {
    background: #002623;
}

.file-upload-status {
    display: none;
    margin-top: 8px;
    padding: 8px 11px;
    border: 1px solid rgba(66, 127, 119, 0.25);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-emerald);
    font-size: 0.72rem;
    line-height: 1.6;
}

.file-upload-actions {
    display: none;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 9px;
    padding: 9px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-soft) 100%);
    box-shadow: 0 3px 10px rgba(0, 38, 35, 0.06);
}

/* الوثيقة المحفوظة على الخادم */
.stored-doc-card {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid rgba(66, 127, 119, 0.35);
    border-radius: 8px;
    background: var(--surface-soft);
    font-size: 0.78rem;
}
.stored-doc-card > i { color: var(--text-info); }
.stored-doc-card.replacing { background: var(--surface-soft); border-color: #B8A678; }
.stored-doc-card.replacing > i { color: var(--text); }
.stored-doc-name { font-weight: 800; color: var(--text); direction: ltr; unicode-bidi: plaintext; word-break: break-all; }
.stored-doc-note { color: var(--text-soft); }
.stored-doc-open {
    margin-right: auto;
    border: 1px solid #B8A678;
    background: var(--surface);
    color: var(--text);
    border-radius: 16px;
    padding: 4px 12px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}
.stored-doc-open:hover { background: var(--surface-soft); }

/* مجموعة التفاضل (تُحدَّد على الخادم من مصدر الإجازة) */
.degree-group-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border: 1px dashed #B8A678;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 0.8rem;
    line-height: 1.6;
}
.degree-group-info.set { border-style: solid; background: var(--surface-soft); color: var(--text); }
.degree-group-info.set span { font-size: 0.74rem; color: var(--text-soft); }

/* ما يمنع إتمام التسجيل، ظاهر في كل صفحة */
.eligibility-list {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-danger);
    border-right: 4px solid #6C1E2B;
    font-size: 0.78rem;
    line-height: 1.8;
}
.eligibility-list strong { display: block; }

/* ما طلبه المدقق: أول ما يراه الطالب في أعلى الصفحة */
.correction-alert {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    border-right: 4px solid #6C1E2B;
    font-size: 0.8rem;
    line-height: 1.8;
}
.correction-alert strong { display: block; color: var(--text-danger); }
.correction-alert .correction-alert-section { margin-top: 6px; }
.correction-alert .correction-alert-message { white-space: pre-line; font-weight: bold; }

.file-upload-actions.is-visible {
    display: flex !important;
    animation: fileActionsIn 0.25s ease-out;
}

.file-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #FFFFFF;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.file-action-btn:hover {
    transform: translateY(-1px);
}

.file-action-btn:focus-visible {
    outline: 3px solid rgba(184, 166, 120, 0.35);
    outline-offset: 2px;
}

.file-preview-btn {
    background: #002623;
    box-shadow: 0 3px 8px rgba(0, 38, 35, 0.2);
}

.file-preview-btn:hover {
    background: #094239;
    box-shadow: 0 5px 12px rgba(0, 38, 35, 0.28);
}

.file-remove-btn {
    background: #6C1E2B;
    box-shadow: 0 3px 8px rgba(108, 30, 43, 0.18);
}

.file-remove-btn:hover {
    background: #6C1E2B;
    box-shadow: 0 5px 12px rgba(108, 30, 43, 0.25);
}

@keyframes fileActionsIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .file-upload-actions {
        align-items: stretch;
    }

    .file-action-btn {
        flex: 1 1 140px;
    }
}

/* ========================================================= */
/* Scroll to Top Button */
/* ========================================================= */

.scroll-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--forest);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    z-index: 999;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top:hover {
    background: var(--golden-wheat);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ========================================================= */
/* Toast Messages */
/* ========================================================= */

.toast-msg {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    min-width: 280px;
    max-width: 450px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    direction: rtl;
}

.toast-msg.show {
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    gap: 12px;
}

.toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-soft);
    font-size: 0.9rem;
    transition: color 0.2s;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-close:hover {
    color: var(--text-danger);
    background: var(--surface-soft);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--golden-wheat), var(--golden-wheat));
    animation: toastProgress linear forwards;
    transform-origin: left;
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.toast-success {
    border-right: 4px solid var(--mountain-teal);
}

.toast-success .toast-icon {
    color: var(--text-info);
}

.toast-success .toast-progress {
    background: linear-gradient(90deg, var(--mountain-teal), #094239);
}

.toast-error {
    border-right: 4px solid var(--damask-red);
}

.toast-error .toast-icon {
    color: var(--text-danger);
}

.toast-error .toast-progress {
    background: linear-gradient(90deg, var(--damask-red), #6C1E2B);
}

.toast-warning {
    border-right: 4px solid var(--golden-wheat);
}

.toast-warning .toast-icon {
    color: var(--golden-wheat);
}

.toast-info {
    border-right: 4px solid var(--edge);
}

.toast-info .toast-icon {
    color: var(--text);
}

/* ========================================================= */
/* Footer */
/* ========================================================= */

footer {
    text-align: center;
    margin-top: 30px;
    font-size: 0.7rem;
    color: var(--text-soft);
    border-top: 1px solid var(--line-soft);
    padding-top: 20px;
}

/* ========================================================= */
/* Warnings & Alerts */
/* ========================================================= */

.section-warning {
    background: var(--surface);
    border-right: 3px solid #6C1E2B;
    padding: 6px 10px;
    margin-bottom: 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-warning i {
    color: var(--text-danger);
    font-size: 0.8rem;
}

.section-warning strong {
    color: var(--text-danger);
}

#age {
    background: var(--surface-soft) !important;
    font-weight: 700;
    color: var(--text) !important;
    text-align: center;
}

.info-banner {
    background: var(--surface-soft);
    border-right: 4px solid #B8A678;
    padding: 8px 12px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.info-banner i {
    color: #B8A678;
    margin-left: 6px;
}

.info-banner ul {
    margin-top: 6px;
    margin-right: 18px;
}

.info-banner li {
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: var(--text);
}

#confirmInfo {
    accent-color: #6C1E2B;
    cursor: pointer;
}

#confirmInfo:hover:not(:disabled) {
    transform: scale(1.05);
}

#confirmInfo:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.input-field input:disabled,
.input-field select:disabled {
    background: var(--surface-soft);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ========================================================= */
/* Error Styles */
/* ========================================================= */

.input-field.error input,
.input-field.error select,
.input-field.error textarea {
    border-color: #6C1E2B !important;
    background-color: var(--surface) !important;
    box-shadow: 0 0 0 2px rgba(108, 30, 43, 0.2) !important;
}

.input-field.error label {
    color: var(--text-danger) !important;
}

.input-field.error label i {
    color: var(--text-danger) !important;
}

.error-message {
    color: var(--text-danger);
    font-size: 0.65rem;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-field input:focus:not(.error input),
.input-field select:focus:not(.error select) {
    border-color: var(--edge);
    box-shadow: var(--shadow-gold);
}

.input-field.error input:focus,
.input-field.error select:focus,
.input-field.error textarea:focus {
    box-shadow: 0 0 0 3px rgba(108, 30, 43, 0.4) !important;
}

/* ========================================================= */
/* Enhanced Checkbox in Page 1 */
/* ========================================================= */

#confirmSection {
    transition: all 0.3s ease;
    position: relative;
}

#confirmSection:hover {
    border-color: var(--golden-wheat);
    background: var(--mohe-beige);
}

#confirmRead {
    transition: all 0.3s ease;
}

#confirmRead:checked {
    accent-color: var(--mohe-gold);
    transform: scale(1.05);
}

#confirmRead:not(:checked) {
    animation: gentlePulse 2s infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(184, 166, 120, 0);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(184, 166, 120, 0.15);
    }
}

#confirmPulse.active {
    animation: pulseRing 1.5s ease-in-out infinite;
}

@keyframes pulseRing {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

#confirmReadHint {
    transition: all 0.3s ease;
}

#confirmReadHint i {
    animation: handWave 2s ease-in-out infinite;
}

@keyframes handWave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-5deg); }
}

/* ========================================================= */
/* Page Error Highlighting */
/* ========================================================= */

.page.page-error {
    background-color: rgba(108, 30, 43, 0.08);
    border-radius: 16px;
    padding: 10px;
    margin: -10px;
    transition: background-color 0.3s ease;
}

.page-error-banner {
    background: linear-gradient(135deg, #6C1E2B, #6C1E2B);
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(108, 30, 43, 0.3);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-error-banner i {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.page-error-banner ul {
    margin: 5px 20px 0 0;
    font-size: 0.8rem;
    font-weight: normal;
}

.page-error-banner li {
    margin-bottom: 3px;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(22, 22, 22, 0.04); }
    50% { box-shadow: 0 2px 20px rgba(184, 166, 120, 0.25), 0 0 0 2px rgba(184, 166, 120, 0.15); }
}

.clean-confirm.ready-to-confirm {
    animation: gentlePulse 2s ease-in-out 3;
    border-color: #B8A678;
}

/* ========================================================= */
/* Bottom Progress Bar */
/* ========================================================= */

.progress-bar-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    box-shadow: 0 -4px 16px rgba(22, 22, 22, 0.1);
    padding: 8px 20px;
    z-index: 999;
    border-top: 2px solid var(--golden-wheat);
}

.progress-bar-container.has-error {
    border-top-color: var(--damask-red);
}

.progress-bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.7rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.progress-label {
    color: var(--text);
    font-weight: 600;
}

.progress-label i {
    color: var(--golden-wheat);
    margin-left: 5px;
}

.progress-percentage {
    font-weight: 800;
    color: var(--text);
}

.progress-fields {
    color: var(--text-soft);
}

.progress-bar-track {
    background: var(--surface-soft);
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--golden-wheat), var(--golden-wheat));
    width: 0%;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* ========================================================= */
/* حقول الـ Stepper المحسنة (معدل الإجازة والامتحان الوطني) */
/* ========================================================= */

/* الحاوية الرئيسية - توسيط شاقولي كامل */
.stepper-group-enhanced {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 14px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    direction: ltr;
    min-height: 46px;
    box-sizing: border-box;
}

/* جزء العدد (صحيح أو عشري) */
.stepper-part {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* تسمية فوق كل جزء */
.stepper-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* صندوق الأزرار والحقل - ارتفاع ثابت */
.stepper-box {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid #B8A678;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface);
    height: 32px;
    box-sizing: border-box;
}

/* حقل إدخال الجزء الصحيح - أزرق */
.stepper-input-int {
    border: none !important;
    text-align: center;
    width: 50px;
    height: 32px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    background: var(--surface-soft);
    padding: 0 4px;
    box-sizing: border-box;
}

/* زر الجزء الصحيح - أزرق */
.stepper-btn-int {
    background: #002623;
    color: white;
    border: none;
    width: 28px;
    height: 32px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: background 0.2s;
    font-family: var(--font-brand);
    box-sizing: border-box;
}

.stepper-btn-int:hover {
    background: #002623;
}

.stepper-btn-int:disabled {
    background: #B8A678;
    cursor: not-allowed;
    opacity: 0.6;
}

/* حقل إدخال الجزء العشري - ذهبي */
.stepper-input-dec {
    border: none !important;
    text-align: center;
    width: 55px;
    height: 32px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    background: var(--surface-soft);
    padding: 0 4px;
    box-sizing: border-box;
}

/* زر الجزء العشري - ذهبي */
.stepper-btn-dec {
    background: #B8A678;
    color: white;
    border: none;
    width: 28px;
    height: 32px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: background 0.2s;
    font-family: var(--font-brand);
    box-sizing: border-box;
}

.stepper-btn-dec:hover {
    background: #978362;
}

.stepper-btn-dec:disabled {
    background: #B8A678;
    cursor: not-allowed;
    opacity: 0.6;
}

/* الفاصلة العشرية - توسيط شاقولي */
.stepper-separator-enhanced {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text);
    margin: 0 2px;
    line-height: 1;
    align-self: center;
}

/* علامة يساوي - توسيط شاقولي */
.stepper-equals {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-info);
    margin: 0 6px;
    align-self: center;
}


/* الحقول المخفية */
input[type="hidden"]#gradPercent,
input[type="hidden"]#nationalGrade {
    display: none;
}

/* حذف التنسيقات القديمة نهائياً */
.stepper-group,
.stepper-dot,
.stepper-result,
.stepper-btn:not(.stepper-btn-int):not(.stepper-btn-dec),
.stepper-input:not(.stepper-input-int):not(.stepper-input-dec) {
    display: none;
}

/* ========================================================= */
/* Mobile Responsive */
/* ========================================================= */

@media (max-width: 768px) {
    body {
        padding: 12px;
        padding-bottom: 80px;
    }

    .page-progress-container {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
        border-radius: 20px;
    }

    .page-progress-steps {
        justify-content: center;
    }

    .step {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
    }

    .page-progress-text {
        font-size: 0.7rem;
    }

    .top-actions {
        gap: 6px;
    }

    .btn-progress-action {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
    }

    .form-card {
        padding: 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .official-header {
        padding: 12px;
        margin-bottom: 20px;
    }

    .survey-header-container {
        padding: 15px;
        margin-bottom: 20px;
    }

    .survey-main-title {
        font-size: clamp(1rem, 2.5vw, 1.3rem);
    }

    h1 {
        font-size: 1rem;
    }

    .announce-card {
        padding: 1rem;
        margin-bottom: 15px;
    }

    .announce-title {
        font-size: 1rem;
    }

    .scroll-top {
        bottom: 70px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .bottom-nav-bar {
        padding: 10px 14px;
        border-radius: 40px;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
    }

    .btn-nav {
        padding: 8px 14px;
        font-size: 0.7rem;
        min-width: 60px;
    }

    .btn-nav i {
        font-size: 0.7rem;
    }

    .btn-nav.btn-start {
        min-width: 100px;
    }

    .btn-nav.btn-review {
        min-width: 120px;
    }

    .page-indicator {
        padding: 4px 12px;
        font-size: 0.7rem;
    }

    .page-indicator i {
        font-size: 0.7rem;
    }

    .page-indicator span {
        font-size: 0.7rem;
    }

    .btn-nav span {
        display: none;
    }

    .btn-nav i {
        margin: 0;
    }

    .progress-bar-container {
        padding: 5px 12px;
    }

    .progress-bar-info {
        font-size: 0.6rem;
    }

    .status-indicator .text {
        font-size: 0.7rem;
    }

    .status-indicator .countdown {
        font-size: 0.55rem;
    }

    .floating-dashboard-btn {
        width: 45px;
        height: 45px;
        bottom: 80px;
        left: 12px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .bottom-nav-bar {
        padding: 6px 10px;
        border-radius: 30px;
        gap: 4px;
    }

    .btn-nav {
        padding: 6px 10px;
        font-size: 0.6rem;
        min-width: 40px;
    }

    .btn-nav.btn-start {
        min-width: 70px;
    }

    .btn-nav.btn-review {
        min-width: 80px;
    }

    .page-indicator {
        padding: 3px 8px;
    }

    .page-indicator span {
        font-size: 0.6rem;
    }

    .step {
        width: 24px;
        height: 24px;
        font-size: 0.55rem;
        border-width: 1.5px;
    }

    .step.completed::after {
        font-size: 0.6rem;
    }

    .btn-progress-action {
        width: 24px;
        height: 24px;
        font-size: 0.55rem;
        border-width: 1.5px;
    }

    .toast-msg {
        width: 90%;
        min-width: auto;
        bottom: 20px;
    }
    
    .toast-content {
        padding: 10px 14px;
    }
    
    .toast-message {
        font-size: 0.8rem;
    }

    .floating-dashboard-btn {
        width: 40px;
        height: 40px;
        bottom: 70px;
        left: 10px;
        font-size: 1rem;
    }
}

/* ========================================================= */
/* زر لوحة التحكم في الشريط العلوي */
/* ========================================================= */

#helpBtn:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(184, 166, 120, 0.3);
}

.floating-dashboard-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 38, 35, 0.4);
    background: linear-gradient(135deg, var(--golden-wheat), var(--golden-wheat));
}

.floating-dashboard-btn .tooltip {
    position: absolute;
    right: 65px;
    background: var(--forest);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: var(--font-brand);
    font-weight: 600;
}

.floating-dashboard-btn:hover .tooltip {
    opacity: 1;
}

.step.locked {
    background: #3C3A3B !important;
    color: #3C3A3B !important;
    border-color: #3C3A3B !important;
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    animation: none !important;
    box-shadow: none !important;
}

.step.locked .step-number {
    display: none;
}

.step.locked::after {
    content: "🔒";
    font-size: 0.6rem;
}

@keyframes pulseOnce {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ========================================================= */
/* قسم تأكيد صحة المعلومات - تصميم أنيق */
/* ========================================================= */

.clean-confirm {
    background: var(--surface) !important;
    border: 2px solid #B8A678 !important;
    border-radius: 14px !important;
    padding: 22px 26px !important;
    margin-top: 20px !important;
    box-shadow: 0 4px 16px rgba(22, 22, 22, 0.08) !important;
}

.clean-confirm-header {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    margin-bottom: 16px !important;
}

.clean-confirm-icon {
    color: #B8A678 !important;
    font-size: 1.3rem !important;
}

.clean-confirm-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--text) !important;
}

.clean-confirm-badge {
    margin-right: auto !important;
    background: var(--surface-soft) !important;
    color: var(--text) !important;
    padding: 3px 12px !important;
    border-radius: 14px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    border: 1px solid #B8A678 !important;
}

.clean-checkbox-row {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: var(--surface) !important;
    border: 1.5px solid var(--line-soft) !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
}

.clean-checkbox-row input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    accent-color: #427F77 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.clean-checkbox-text {
    font-size: 0.88rem !important;
    color: var(--text-soft) !important;
    line-height: 1.6 !important;
}

.clean-checkbox-text strong {
    color: var(--text) !important;
}

.clean-confirm-hint {
    margin-top: 12px !important;
    padding: 8px 14px !important;
    background: var(--surface-soft) !important;
    border-radius: 8px !important;
    font-size: 0.78rem !important;
    color: var(--text-soft) !important;
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
}

.input-field-edit label { display: block; font-weight: 600; font-size: 0.7rem; color: var(--text); margin-bottom: 3px; }
        .input-field-edit input, .input-field-edit textarea {
            width: 100%; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 6px;
            font-family: var(--font-brand); font-size: 0.75rem;
        }      
/* ======================================== */
/* تأثير نبض لـ checkbox الموافقة */
/* ======================================== */

@keyframes pulseConfirm {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(66, 127, 119, 0.6); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 12px rgba(66, 127, 119, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(66, 127, 119, 0); }
}

.desire-block[hidden] {
    display: none !important;
}

.desire-count-field {
    max-width: 360px;
    margin: 0 0 20px auto;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--surface);
}

/* ========================================
   Student Entry Gateway - Account Phase
   ======================================== */
.student-entry-gate { margin: 18px 0 22px; }
.student-entry-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface) 100%);
  border: 1px solid var(--line-soft); border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 38, 35, 0.08);
  padding: 28px; display: flex; gap: 22px; align-items: flex-start; text-align: right;
}
.student-entry-icon {
  flex: 0 0 64px; width: 64px; height: 64px; border-radius: 16px;
  background: #002623; color: #FFFFFF; display: flex; align-items: center; justify-content: center;
  font-size: 1.55rem; box-shadow: 0 6px 16px rgba(0, 38, 35, 0.16);
}
.student-entry-content { flex: 1; min-width: 0; }
.student-entry-kicker { display:block; color:var(--text); font-size:.74rem; font-weight:800; margin-bottom:4px; }
.student-entry-content h2 { color:var(--text); font-size:1.25rem; margin:0 0 8px; }
.student-entry-intro { color:var(--text-soft); font-size:.82rem; line-height:1.8; margin:0 0 18px; }
.account-choice-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.account-choice-card {
  appearance:none; border:1px solid var(--line-soft); border-radius:13px; background:var(--surface); padding:15px;
  display:flex; align-items:center; gap:12px; text-align:right; cursor:pointer;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
  font-family:inherit; color:inherit;
}
.account-choice-card:hover { transform:translateY(-2px); box-shadow:0 7px 18px rgba(0, 38, 35, .09); border-color:#B8A678; }
.account-choice-primary { border-right:4px solid var(--edge); }
.account-choice-secondary { border-right:4px solid #B8A678; }
.account-choice-icon { width:42px; height:42px; flex:0 0 42px; border-radius:11px; display:flex; align-items:center; justify-content:center; background:var(--surface-soft); color:var(--text); font-size:1rem; }
.account-choice-secondary .account-choice-icon { background:var(--surface-soft); color:var(--text-sand); }
.account-choice-text { flex:1; min-width:0; }
.account-choice-text strong { display:block; color:var(--text); font-size:.86rem; margin-bottom:3px; }
.account-choice-text small { display:block; color:var(--text-soft); font-size:.7rem; line-height:1.5; }
.account-choice-arrow { color:var(--text-soft); font-size:.72rem; }
.student-entry-divider { display:flex; align-items:center; gap:12px; margin:18px 0 13px; color:var(--text-soft); font-size:.72rem; font-weight:700; }
.student-entry-divider::before,.student-entry-divider::after { content:''; height:1px; background:var(--surface-soft); flex:1; }
.account-bypass-btn {
  width:100%; border:1px dashed #094239; border-radius:12px; background:var(--surface); color:var(--text);
  padding:12px 16px; font-family:inherit; font-size:.82rem; font-weight:800; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:8px; transition:background .18s ease,border-color .18s ease;
}
.account-bypass-btn:hover { background:var(--surface-soft); border-color:var(--edge); }
.student-entry-note {
  margin-top:12px; padding:9px 12px; border-radius:9px; background:var(--surface); color:var(--text-soft);
  font-size:.68rem; line-height:1.65; display:flex; gap:7px; align-items:flex-start;
}
.student-entry-note i { color:#B8A678; margin-top:2px; }
/* ===== لوحات الحساب: إنشاء / دخول / استعادة ===== */
.account-panel { margin-top:6px; }
.account-panel h3 {
  font-size:.92rem; color:var(--text); margin-bottom:6px;
  display:flex; align-items:center; gap:8px;
}
.account-panel h3 i { color:#B8A678; }
.account-hint { font-size:.74rem; color:var(--text-soft); line-height:1.7; margin-bottom:12px; }
.account-grid {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:12px; margin-top:12px;
}
.account-field { display:block; }
.account-field > span {
  display:block; font-size:.74rem; font-weight:800; color:var(--text); margin-bottom:4px;
}
.account-field input,
.account-field select {
  width:100%; padding:10px 12px; border:1px solid var(--line-soft); border-radius:10px;
  font-family:inherit; font-size:.85rem; background:var(--surface);
}
.account-field input:focus,
.account-field select:focus { border-color:var(--edge); outline:none; box-shadow:0 0 0 3px rgba(184, 166, 120, .15); }
.account-field small { display:block; font-size:.67rem; color:var(--text-soft); margin-top:3px; line-height:1.5; }
.account-field-wide { grid-column:1 / -1; }
/* The three grades of the academic page. On a phone the steppers need the
   full width: three columns pushed «المعدل التفاضلي» out of the card
   (owner's testing, 2026-09-27). */
.grades-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grades-row > .input-field { min-width: 0; }
@media (max-width: 760px) {
  .grades-row { grid-template-columns: minmax(0, 1fr); }
}
/* The applicant's note about the national exam (owner, 2026-09-28). */
.exam-note-field textarea {
  width:100%; min-height:78px; resize:vertical; padding:10px 12px; border-radius:10px;
  border:1px solid var(--line-strong); background:var(--surface); color:var(--text);
  font-family:inherit; font-size:.86rem; line-height:1.7;
}
.exam-note-field textarea:focus { outline:none; border-color:var(--edge); box-shadow:0 0 0 3px var(--golden-wheat); }
.exam-note-optional { font-weight:400; color:var(--text-soft); font-size:.78em; }
.exam-note-count { margin-top:3px; font-size:.7rem; color:var(--text-soft); text-align:left; }
/* The phone is fixed after sign-up: say so where it is typed (owner, 2026-09-27). */
.account-phone-warning {
  display:flex; align-items:flex-start; gap:8px; margin-top:6px; padding:9px 11px; border-radius:8px;
  background:var(--surface-soft); border:1px solid var(--line-strong); border-inline-start:4px solid var(--damask-red);
  color:var(--text); font-size:.74rem; line-height:1.65;
}
.account-phone-warning > i { color:var(--text-danger); margin-top:3px; }
.account-phone-warning strong { color:var(--text-danger); }
/* Account data shown in the form but changed only by support (owner, 2026-09-27). */
.account-locked-note { display:block; margin-top:4px; font-size:.7rem; color:var(--text-soft); line-height:1.5; }
.account-locked-note i { margin-inline-end:4px; }
/* The value a reviewer asked to change, beside its «تعديل» button. */
.correction-previous {
  display:inline-flex; align-items:center; gap:6px; margin:4px 0; padding:3px 9px; border-radius:6px;
  border:1px solid var(--damask-red); color:var(--text-danger); background:var(--surface);
  font-size:.74rem; font-weight:700;
}
.account-field small.is-error { color:var(--text-danger); font-weight:700; }
.account-field small.is-ok { color:var(--text-emerald); font-weight:700; }
/* Revealing the password matters on phones, where a mistyped character is
   invisible and the lockout after five failures is unforgiving. */
.password-wrap { position:relative; }
.password-wrap input { padding-inline-end:42px; }
.password-toggle {
  position:absolute; inset-inline-end:6px; top:50%; transform:translateY(-50%);
  border:0; background:none; cursor:pointer; color:var(--text-soft);
  width:32px; height:32px; border-radius:8px; font-size:.85rem;
}
.password-toggle:hover { color:var(--text); background:var(--surface-soft); }
.account-warning {
  margin-top:14px; padding:11px 13px; border-radius:10px;
  background:var(--surface-soft); border:1px solid #B8A678; color:var(--text-umber);
  font-size:.73rem; line-height:1.7; display:flex; gap:9px; align-items:flex-start;
}
.account-warning i { color:#B8A678; margin-top:2px; font-size:.9rem; }
.account-msg { display:none; margin-top:12px; padding:10px 13px; border-radius:9px; font-size:.76rem; line-height:1.6; }
.account-msg.show { display:block; }
.account-msg-error { background:var(--surface-soft); color:var(--text-danger); border-right:4px solid #6C1E2B; }
.account-msg-ok { background:var(--surface-soft); color:var(--text-emerald); border-right:4px solid #427F77; }
.account-msg-ok[hidden] { display:none !important; }
.recovery-status { display:flex; align-items:center; gap:8px; margin:10px 0; font-size:.78rem; font-weight:800; color:var(--text-soft); }
.recovery-led { width:12px; height:12px; border-radius:50%; background:#978362; box-shadow:0 0 0 3px rgba(151,131,98,.16); flex:0 0 auto; }
.recovery-status.is-verified { color:var(--text-emerald); }
.recovery-status.is-verified .recovery-led { background:var(--mountain-teal); box-shadow:0 0 0 3px rgba(66,127,119,.16); }
.recovery-status.is-error { color:var(--text-danger); }
.recovery-status.is-error .recovery-led { background:var(--damask-red); box-shadow:0 0 0 3px rgba(108,30,43,.14); }
.recovery-password-step[disabled] { opacity:.58; }
.recovery-password-step[disabled] input, .recovery-password-step[disabled] button { cursor:not-allowed; }
.recovery-intro { max-width:760px; }
.recovery-progress { display:flex; list-style:none; padding:0; margin:14px 0; gap:8px; flex-wrap:wrap; }
.recovery-progress li { display:flex; align-items:center; gap:7px; color:var(--text-soft); font-size:.75rem; font-weight:800; }
.recovery-progress li span { display:inline-grid; place-items:center; width:23px; height:23px; border:1px solid #B8A678; border-radius:50%; background:var(--surface); color:var(--text-soft); }
.recovery-progress li.is-current { color:var(--text); }
.recovery-progress li.is-current span { background:#002623; color:#FFFFFF; border-color:#002623; }
.recovery-step { border:1px solid var(--line-soft); border-radius:14px; padding:16px; background:var(--surface); }
.recovery-step-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; border-bottom:1px solid var(--line-soft); padding-bottom:10px; margin-bottom:12px; }
.recovery-step-head h4 { margin:0; color:var(--text); font-size:.94rem; }
.recovery-step-head h4 i { color:var(--text-sand); margin-left:5px; }
.recovery-step-head p { margin:4px 0 0; color:var(--text-soft); font-size:.73rem; }
.recovery-attempts { display:inline-flex; align-items:center; gap:6px; margin:0 0 12px; padding:7px 10px; border-radius:8px; background:var(--surface-soft); color:var(--text); font-size:.74rem; }
.recovery-attempts i { color:var(--text-sand); }
.recovery-identity-grid { grid-template-columns:repeat(6,minmax(0,1fr)); margin-top:0; }
.recovery-identity-grid .account-field { grid-column:span 2; }
.recovery-identity-grid .account-field:nth-child(4), .recovery-identity-grid .account-field:nth-child(5) { grid-column:span 3; }
.recovery-field-help { margin-top:5px; color:var(--text-soft); font-size:.68rem; line-height:1.6; }
.recovery-field-help summary { cursor:pointer; color:var(--text); font-weight:700; }
.recovery-field-help span { display:block; padding-top:4px; }
.recovery-password-step { margin-top:14px; border-color:#B8A678; background:var(--surface); }
.recovery-password-step:not([disabled]) { opacity:1; border-color:#427F77; box-shadow:0 0 0 3px rgba(66,127,119,.09); }
@media (max-width:700px) {
  .recovery-step-head { flex-direction:column; }
  .recovery-identity-grid { grid-template-columns:1fr; }
  .recovery-identity-grid .account-field, .recovery-identity-grid .account-field:nth-child(4), .recovery-identity-grid .account-field:nth-child(5) { grid-column:auto; }
}
.account-actions { display:flex; gap:9px; align-items:center; flex-wrap:wrap; margin-top:15px; }
.btn-account-primary {
  border:0; border-radius:24px; padding:11px 22px; cursor:pointer;
  background:linear-gradient(135deg,#002623,#002623); color:#FFFFFF;
  font-family:inherit; font-size:.82rem; font-weight:800;
  display:inline-flex; align-items:center; gap:8px;
  transition:transform .18s ease,box-shadow .18s ease;
}
.btn-account-primary:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 6px 16px rgba(0, 38, 35, .25); }
.btn-account-primary:disabled { opacity:.6; cursor:not-allowed; transform:none; }
.btn-account-plain {
  border:1px solid var(--line-soft); background:var(--surface); border-radius:24px; padding:10px 18px;
  cursor:pointer; font-family:inherit; font-size:.78rem; font-weight:700; color:var(--text-soft);
}
.btn-account-plain:hover { background:var(--surface-soft); }
.btn-account-link {
  border:0; background:none; color:var(--text); cursor:pointer;
  font-family:inherit; font-size:.76rem; font-weight:700; text-decoration:underline;
  margin-inline-start:auto;
}
/* Sign-out is easy to find on a shared device (owner, 2026-09-27): a full
   button, the same on the form and the account page. The forest ground stays
   dark in both themes, so its white text and gold edge read on either. */
.btn-student-logout {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:44px; padding:8px 18px; border-radius:10px; cursor:pointer;
  background:var(--forest); color:#FFFFFF; border:2px solid var(--golden-wheat);
  font-family:inherit; font-size:.86rem; font-weight:800; white-space:nowrap;
  margin-inline-start:auto; transition:box-shadow .18s ease;
}
.btn-student-logout:hover, .btn-student-logout:focus-visible {
  box-shadow:0 0 0 3px var(--golden-wheat); outline:none;
}
.btn-student-logout[hidden] { display:none; }
/* ===== أين وصل الطالب في ملفه ===== */
.file-progress {
  background:var(--surface); border:1px solid var(--line-soft); border-radius:14px;
  padding:14px 18px; margin-bottom:16px;
  box-shadow:0 2px 10px rgba(22, 22, 22, .04);
}
.file-progress[hidden] { display:none; }
.progress-steps { display:flex; gap:8px; flex-wrap:wrap; }
.progress-step {
  display:inline-flex; align-items:center; gap:7px;
  border:1px solid var(--line-soft); background:var(--surface); color:var(--text-soft);
  border-radius:22px; padding:8px 14px; cursor:pointer;
  font-family:inherit; font-size:.78rem; font-weight:700;
  transition:border-color .18s ease, background .18s ease;
}
.progress-step:hover { border-color:var(--edge); color:var(--text); }
.progress-step .mark {
  width:19px; height:19px; border-radius:50%; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:.7rem; background:var(--surface-soft); color:var(--text-soft);
}
.progress-step.done { background:var(--surface-soft); border-color:#B8A678; color:var(--text-emerald); }
.progress-step.done .mark { background:#094239; color:#FFFFFF; }
.progress-step.back { background:var(--surface-soft); border-color:#B8A678; color:var(--text); }
.progress-step.back .mark { background:#002623; color:#FFFFFF; }
.progress-summary {
  margin-top:10px; font-size:.76rem; color:var(--text-soft); font-weight:600;
}

/* ===== شريط حفظ وإرسال القسم ===== */
.section-bar {
  margin:16px 0 0; padding:14px 16px; border-radius:12px;
  background:var(--surface); border:1px solid var(--line-soft);
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
}
.section-state {
  display:flex; align-items:center; gap:7px;
  font-size:.78rem; font-weight:800; color:var(--text-soft);
}
.section-state i { font-size:.7rem; }
.section-state.submitted { color:var(--text-emerald); }
.section-state.locked { color:var(--text); }
.section-state.saved { color:var(--text); }
/* Deliberately quiet: reassurance that nothing was lost, never a claim that
   the section was submitted. */
.autosave-hint { font-size:.7rem; color:var(--text-soft); font-weight:600; }
.autosave-hint.ok { color:var(--text-emerald); }
.autosave-hint.busy { color:var(--text-soft); }
.autosave-hint.err { color:var(--text-danger); }
.section-buttons { display:flex; gap:8px; margin-inline-start:auto; flex-wrap:wrap; }
.btn-section-save, .btn-section-submit {
  border:0; border-radius:22px; padding:10px 18px; cursor:pointer;
  font-family:inherit; font-size:.78rem; font-weight:800;
  display:inline-flex; align-items:center; gap:7px;
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn-section-save { background:var(--surface); color:var(--text); border:1px solid #B8A678; }
.btn-section-save:hover:not(:disabled) { background:var(--surface-soft); }
.btn-section-submit { background:linear-gradient(135deg,#427F77,#094239); color:#FFFFFF; }
.btn-section-submit:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 6px 16px rgba(66, 127, 119, .28); }
.btn-section-save:disabled, .btn-section-submit:disabled { opacity:.5; cursor:not-allowed; transform:none; }
/* «إرسال» يسبق «التالي» مباشرة في صف واحد (المالك 2026-09-16) */
.section-buttons:empty { display:none; }
.nav-forward { display:inline-flex; align-items:center; gap:10px; flex-wrap:nowrap; }
.nav-forward .btn-section-submit { border-radius:40px; padding:10px 22px; font-size:.85rem; white-space:nowrap; }
@media (max-width: 768px) {
  /* على الهاتف: «إرسال» و«التالي» معاً في سطرهما، لا يُدفع أحدهما خارج الشاشة */
  .bottom-nav-bar:has(.nav-forward) { flex-wrap:wrap; overflow:visible; border-radius:20px; row-gap:8px; }
  .nav-forward { gap:6px; flex:1 1 100%; justify-content:flex-end; }
  .nav-forward .btn-section-submit { padding:8px 12px; font-size:.78rem; flex:1 1 auto; justify-content:center; }
}
/* «تعديل هذا القسم»: متاح ما دام الملف لم يُسجَّل نهائياً */
.btn-section-reopen {
  border:1px solid var(--edge); border-radius:22px; padding:10px 18px; cursor:pointer;
  font-family:inherit; font-size:.78rem; font-weight:800; background:var(--surface-soft); color:var(--text);
  display:inline-flex; align-items:center; gap:7px; transition:background .18s ease;
}
.btn-section-reopen:hover { background:var(--surface-soft); }
/* Clears the fields of its own section only (owner, 2026-09-27). */
.btn-section-clear {
  border:1px solid var(--line-strong); border-radius:22px; padding:10px 18px; cursor:pointer;
  font-family:inherit; font-size:.78rem; font-weight:800; background:var(--surface); color:var(--text-soft);
  display:inline-flex; align-items:center; gap:7px; transition:border-color .18s ease, color .18s ease;
}
.btn-section-clear:hover:not(:disabled) { border-color:var(--damask-red); color:var(--text-danger); }
.btn-section-clear:disabled { opacity:.55; cursor:not-allowed; }
.section-msg {
  flex-basis:100%; font-size:.75rem; line-height:1.6; display:none;
  padding:9px 12px; border-radius:8px;
}
.section-msg.show { display:block; }
.section-msg.ok { background:var(--surface-soft); color:var(--text-emerald); border-right:4px solid #094239; }
.section-msg.err { background:var(--surface-soft); color:var(--text-danger); border-right:4px solid #6C1E2B; }
.section-msg.warn { background:var(--surface-soft); color:var(--text); border-right:4px solid var(--edge); }

/* السطر التقليدي أسفل الزر للتبديل بين الإنشاء والدخول */
.account-switch {
  margin-top:16px; padding-top:14px; border-top:1px solid var(--line-soft);
  text-align:center; font-size:.78rem; color:var(--text-soft);
}
.account-switch button {
  border:0; background:none; padding:0 4px; cursor:pointer;
  font-family:inherit; font-size:.82rem; font-weight:800; color:var(--text);
  text-decoration:underline;
}
.account-switch button:hover { color:var(--text); }
.account-signed-in {
  display:flex; align-items:center; gap:9px; margin:0 0 14px;
  padding:11px 14px; border-radius:10px;
  background:var(--surface-soft); border:1px solid #B8A678; color:var(--text-emerald);
  font-size:.78rem; font-weight:700;
}
/* `display:flex` would otherwise defeat the hidden attribute. */
.account-signed-in[hidden] { display:none; }
.account-signed-in i { color:var(--text-emerald); }
.account-panel[hidden] { display:none; }

/* ===== بوابة الحساب: تبويبان ومجموعات حقول (المالك 2026-09-19) ===== */
.account-tabs {
  display:grid; grid-template-columns:1fr 1fr; gap:4px; padding:4px; margin:4px 0 18px;
  background:var(--surface-soft); border-radius:14px;
}
.account-tabs button {
  border:0; border-radius:11px; padding:10px 12px; cursor:pointer; background:transparent;
  font-family:inherit; font-size:.82rem; font-weight:800; color:var(--text-soft);
  display:flex; align-items:center; justify-content:center; gap:8px;
  transition:background .18s ease,color .18s ease,box-shadow .18s ease;
}
.account-tabs button:hover { color:var(--text); }
.account-tabs button[aria-selected="true"] {
  background:var(--surface); color:var(--text); box-shadow:0 2px 8px rgba(0, 38, 35, .10);
}
.account-tabs button[aria-selected="true"] i { color:var(--text-sand); }
/* the tabs already name the panel */
#accountPanelLogin > h3, #accountPanelCreate > h3 { display:none; }

.account-group {
  border:1px solid var(--line-soft); border-radius:14px; padding:14px 16px 16px; margin:0 0 14px;
  background:var(--surface);
}
.account-group legend {
  padding:0 8px; font-size:.8rem; font-weight:800; color:var(--text);
  display:flex; align-items:center; gap:7px;
}
.account-group legend i { color:var(--text-sand); }
.account-group legend small { font-size:.67rem; font-weight:600; color:var(--text-soft); }
.account-group .account-grid { margin-top:4px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.account-group .account-warning { margin-top:12px; }
.account-grid-single { grid-template-columns:1fr; }

.account-field input.is-invalid,
.account-field select.is-invalid { border-color:#6C1E2B; box-shadow:0 0 0 3px rgba(108, 30, 43, .10); }
.account-field small.field-error { color:var(--text-danger); font-weight:700; }

.password-meter { height:4px; border-radius:4px; background:var(--surface-soft); margin-top:6px; overflow:hidden; }
.password-meter i { display:block; height:100%; width:0; border-radius:4px; transition:width .2s ease,background .2s ease; }
.password-meter i.is-weak { background:#6C1E2B; }
.password-meter i.is-fair { background:#B8A678; }
.password-meter i.is-good { background:#427F77; }
.password-meter i.is-strong { background:#094239; }

.btn-account-block { width:100%; justify-content:center; padding:13px 22px; font-size:.88rem; }
.account-actions-stack { flex-direction:column; align-items:stretch; }
.account-actions-stack .btn-account-link { margin-inline-start:0; align-self:center; }

@media (max-width:700px) {
  .account-group { padding:12px; }
  .account-group .account-grid { grid-template-columns:1fr; }
  .student-entry-card { padding:20px; flex-direction:column; }
  .student-entry-icon { width:52px; height:52px; flex-basis:52px; }
  .account-choice-grid { grid-template-columns:1fr; }
  .account-grid { grid-template-columns:1fr; }
  .btn-account-link { margin-inline-start:0; }
}
