/* ==========================================================================
   MARW Admission Portal — Maqraa-Inspired Islamic Design
   Palette: Gold/cream/white with Islamic geometric patterns
   ========================================================================== */

:root {
    /* Maqraa gold palette */
    --gold-dark: #8B6914;
    --gold: #B8860B;
    --gold-medium: #C49A3C;
    --gold-light: #D4B06A;
    --gold-pale: #E8D5A8;
    --gold-bg: #F5EFE0;

    /* Vert institutionnel du bandeau et des onglets actifs */
    --vert: #1F4D3B;
    --vert-fonce: #173D2F;
    --vert-clair: #2E6B52;

    /* Olive/green accents (secondary) */
    --olive: #5C7A3A;
    --olive-light: #7A9A5A;
    --olive-pale: #E8EFE0;

    /* Neutrals */
    --white: #FFFFFF;
    --cream: #FAF8F3;
    --cream-dark: #F0ECE3;
    --text: #3D3526;
    /* Greyscale bumped one notch darker for WCAG AA contrast on the cream bg
       (the previous muted/light were ~4.0/2.3:1 — both failed for small text). */
    --text-muted: #6B6253;
    --text-light: #7A7060;
    --border: #E0D8C8;
    --border-light: #EDE8DD;

    /* Status */
    --success: #5C7A3A;
    --warning: #C49A3C;
    --danger: #A0382A;
    --info: #3A5C7A;

    /* Spacing & shapes */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 2px 16px rgba(139,105,20,0.08);
    --shadow-lg: 0 8px 32px rgba(139,105,20,0.12);
    --transition: 0.25s ease;
}

/* Islamic geometric pattern (SVG data URI) */
.pattern-bg {
    background-color: var(--cream);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='%23E0D8C8' stroke-width='0.5'/%3E%3Cpath d='M30 10L50 30L30 50L10 30Z' fill='none' stroke='%23E0D8C8' stroke-width='0.3'/%3E%3C/svg%3E");
}

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

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--cream);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='%23E0D8C8' stroke-width='0.5'/%3E%3Cpath d='M30 10L50 30L30 50L10 30Z' fill='none' stroke='%23E0D8C8' stroke-width='0.3'/%3E%3C/svg%3E");
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
}

/* ==========================================================================
   Navbar — White with gold accents (maqraa style)
   ========================================================================== */

.navbar {
    background: var(--white);
    padding: 10px 2rem;
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(139,105,20,0.08);
    border-bottom: 2px solid var(--gold-pale);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}
/* Marque typographique officielle (trilingue) du ministère */
.nav-marque {
    height: 60px;
    width: auto;
    display: block;
}
/* Drapeau algérien rond, juste après le logo du ministère. */
.nav-drapeau {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--white), 0 0 0 3px var(--border);
}
.nav-separateur {
    width: 1px;
    height: 48px;
    background: var(--border);
    display: block;
}
.nav-titre-bloc {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.nav-title {
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 800;
    line-height: 1.3;
}
.nav-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.nav-nom {
    color: var(--vert);
    font-size: 0.9rem;
    font-weight: 700;
}
/* Bouton « mon espace » : pastille verte pleine, icône personne */
.btn-espace {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--vert);
    color: var(--white);
    border-radius: 14px;
    padding: 12px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}
.btn-espace::before {
    content: '';
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 3.6-7 8-7s8 3 8 7'/%3E%3C/svg%3E") center/contain no-repeat;
}
.btn-espace:hover { background: var(--vert-clair); }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-lang {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    color: var(--text);
    border: 1.5px solid var(--border);
    padding: 11px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: var(--transition);
}
.btn-lang::before {
    content: '';
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233D3526' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c3 3.5 3 14.5 0 18M12 3c-3 3.5-3 14.5 0 18'/%3E%3C/svg%3E") center/contain no-repeat;
}
.btn-lang:hover {
    border-color: var(--vert);
    color: var(--vert);
}

/* ==========================================================================
   Main content
   ========================================================================== */

.main-content {
    flex: 1;
    max-width: 1140px;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem 2rem 2rem;
}

/* ==========================================================================
   Footer — Dark olive/brown with gold text (maqraa style)
   ========================================================================== */

.footer {
    background: linear-gradient(135deg, #4A3F28, #5C4F32);
    color: var(--gold-pale);
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* ==========================================================================
   Ornamental divider (gold line with rosette center)
   ========================================================================== */

.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0.6rem auto;
    max-width: 420px;
}
.ornament::before, .ornament::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to var(--dir, left), var(--gold), transparent);
}
.ornament::after { --dir: right; }
.ornament-icon {
    width: 26px;
    height: 26px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 0.9rem;
    margin: 0 12px;
    background: var(--cream);
}

/* ==========================================================================
   Hero — Large calligraphic section (maqraa style)
   ========================================================================== */

.hero-band {
    background-color: var(--vert);
    background-image:
        repeating-linear-gradient(45deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 72px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 72px);
    color: var(--white);
}
.hero {
    max-width: 1140px;
    margin: 0 auto;
    padding: 2.6rem 2rem 2.4rem;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
}
.hero-saison {
    display: inline-block;
    color: var(--gold-light);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}
.hero h1 {
    font-family: 'Amiri', serif;
    font-size: 2.9rem;
    color: var(--white);
    font-weight: 700;
    margin-bottom: 0.7rem;
    line-height: 1.25;
}
.hero p {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.86);
    max-width: 560px;
    line-height: 1.8;
    margin: 0;
}
.hero-etapes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.etape {
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 20px 12px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.etape-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold-light);
    color: var(--vert-fonce);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.etape-titre {
    font-weight: 800;
    font-size: 1rem;
}
.etape-desc {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
}

/* ==========================================================================
   Cards — White with subtle gold border
   ========================================================================== */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-lg);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gold-pale);
}
.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-dark);
}

/* ==========================================================================
   Register cards — Arch-frame inspired
   ========================================================================== */

.register-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}
.register-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}
.register-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}
.register-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.register-card-header {
    background: var(--cream);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}
.register-card-header h3 {
    font-size: 1.15rem;
    color: var(--gold-dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.register-card-body {
    padding: 1.5rem;
}
.register-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.register-meta-item {
    font-size: 0.9rem;
}
.register-meta-label {
    color: var(--text-light);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 2px;
}
.register-meta-value {
    font-weight: 600;
    color: var(--text);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.badge-concours {
    background: var(--gold);
    color: var(--white);
}
.badge-open {
    background: var(--olive);
    color: var(--white);
}
.badge-closed {
    background: var(--text-light);
    color: var(--white);
}

/* ==========================================================================
   Buttons — Gold primary (maqraa style)
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 28px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.3px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
    box-shadow: 0 2px 8px rgba(184,134,11,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-dark), #6B5010);
    box-shadow: 0 4px 16px rgba(184,134,11,0.4);
}
.btn-gold {
    background: var(--gold);
    color: var(--white);
}
.btn-gold:hover {
    background: var(--gold-dark);
}
.btn-outline {
    background: transparent;
    color: var(--gold-dark);
    border: 2px solid var(--gold-light);
}
.btn-outline:hover {
    background: var(--gold);
    color: var(--white);
    border-color: var(--gold);
}
.btn-olive {
    background: var(--olive);
    color: var(--white);
}
.btn-olive:hover {
    background: #4A6630;
}
.btn-sm {
    padding: 7px 18px;
    font-size: 0.85rem;
}
.btn-block {
    width: 100%;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   Forms — Clean with gold labels (maqraa style)
   ========================================================================== */

.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gold-dark);
}
.form-label .required {
    color: var(--danger);
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--white);
    font-family: inherit;
    color: var(--text);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,134,11,0.1);
}
.form-input::placeholder {
    color: var(--text-light);
}

/* ==========================================================================
   Styled file input — hides the native English "Choose File" chrome and shows
   a gold button + the chosen filename (localized via app-toggle.js).
   ========================================================================== */
.file-input {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.file-input input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.file-input-btn {
    flex: 0 0 auto;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gold);
    background: var(--gold-bg);
    color: var(--gold-dark);
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}
.file-input:hover .file-input-btn {
    background: var(--gold-pale);
}
.file-input input[type="file"]:focus-visible + .file-input-btn {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
.file-input-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Catalogue result count (above the register grid). */
.register-count {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.register-count #register-count-n {
    font-weight: 700;
    color: var(--gold-dark);
}
.form-textarea {
    resize: vertical;
    min-height: 80px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-error {
    display: block;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ==========================================================================
   Tabs — Gold underline (maqraa nav style with | separators)
   ========================================================================== */

.tabs {
    display: flex;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    margin: 1.6rem 0 1.4rem;
    padding: 6px;
    background: var(--white);
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(31,77,59,0.10);
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: none;
    border: none;
    border-radius: 13px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}
.tab:hover {
    background: var(--cream-dark);
    color: var(--vert);
}
.tab.active {
    background: var(--vert);
    color: var(--white);
}
.tab-compteur {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--gold-light);
    color: var(--vert-fonce);
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tab.active .tab-compteur {
    background: var(--white);
    color: var(--vert);
}

/* ==========================================================================
   Status badges
   ========================================================================== */

.status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}
.status-draft { background: var(--cream-dark); color: var(--text-muted); }
.status-submit { background: #E8F0FA; color: #2A5C8A; }
.status-confirm { background: #FFF5E0; color: var(--gold-dark); }
.status-admission { background: var(--olive-pale); color: var(--olive); }
.status-payment_process { background: #F0E8FA; color: #5A3A8A; }
.status-fees_paid { background: var(--olive-pale); color: var(--olive); }
.status-done { background: var(--olive); color: var(--white); }
.status-reject { background: var(--danger); color: var(--white); }
.status-pending { background: var(--gold-pale); color: var(--gold-dark); }
.status-cancel { background: #D8D0C0; color: var(--text-muted); }
/* MARW concours states */
.status-concours { background: #E8F0FA; color: #2A5C8A; }
.status-admis_principal { background: var(--olive-pale); color: var(--olive); font-weight: 700; }
.status-admis_attente { background: var(--gold-pale); color: var(--gold-dark); }
.status-inscrit { background: var(--olive); color: var(--white); font-weight: 700; }
.status-dechu { background: var(--danger); color: var(--white); }
/* Ranking row highlights */
.row-admitted { background: rgba(107, 142, 35, .06); }
.row-waiting { background: rgba(184, 152, 58, .06); }

/* ==========================================================================
   Ranking table — Gold header (maqraa style)
   ========================================================================== */

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.25rem;
}
.ranking-table th {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: var(--white);
    padding: 14px 18px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 700;
}
.ranking-table th:first-child {
    border-radius: 0 var(--radius-sm) 0 0;
}
.ranking-table th:last-child {
    border-radius: var(--radius-sm) 0 0 0;
}
[dir="ltr"] .ranking-table th { text-align: left; }
[dir="ltr"] .ranking-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
[dir="ltr"] .ranking-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.ranking-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}
.ranking-table tr:hover td {
    background: rgba(184,134,11,0.04);
}
.rank-medal {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.85rem;
}
.rank-1 { background: #FFD700; color: #3D3526; }
.rank-2 { background: #C0C0C0; color: #3D3526; }
.rank-3 { background: #CD7F32; color: var(--white); }

/* ==========================================================================
   Track result — Gold right border (maqraa style)
   ========================================================================== */

.track-result {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--gold);
    max-width: 600px;
    margin: 1.5rem auto;
}
[dir="ltr"] .track-result {
    border-right: none;
    border-left: 4px solid var(--gold);
}
.track-field {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}
.track-field:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.track-label {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 2px;
}
.track-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

/* ==========================================================================
   Login split-layout (maqraa style: image left, form right)
   ========================================================================== */

.login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--white);
}
.login-decoration {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
.login-decoration::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 0L80 40L40 80L0 40Z' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='1'/%3E%3Cpath d='M40 15L65 40L40 65L15 40Z' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='0.5'/%3E%3C/svg%3E");
    pointer-events: none;
}
.login-decoration-text {
    text-align: center;
    color: var(--white);
    position: relative;
    z-index: 1;
}
.login-decoration-text h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}
.login-decoration-text p {
    font-size: 1rem;
    opacity: 0.85;
}
.login-form-area {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-form-area h2 {
    color: var(--gold-dark);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.login-form-area .form-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* ==========================================================================
   Loading & spinner
   ========================================================================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    gap: 12px;
}
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.toast {
    background: var(--text);
    color: var(--white);
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    font-weight: 600;
}
.toast-success { background: var(--olive); }
.toast-error { background: var(--danger); }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Empty state
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

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

@media (max-width: 768px) {
    .main-content { padding: 1rem; }
    .hero { padding: 1.6rem 1rem 1.4rem; grid-template-columns: 1fr; gap: 1.4rem; }
    .hero h1 { font-size: 2rem; }
    .hero-etapes { grid-template-columns: 1fr; gap: 8px; }
    .etape { flex-direction: row; flex-wrap: wrap; text-align: start; padding: 12px 14px; gap: 6px 12px; }
    .etape-num { margin-bottom: 0; flex: 0 0 auto; }
    .etape-titre { flex: 1 1 auto; }
    .etape-desc { flex-basis: 100%; padding-inline-start: 48px; }
    .nav-marque { height: 44px; }
    .nav-drapeau { width: 34px; height: 34px; }
    .nav-subtitle, .nav-separateur { display: none; }
    .btn-espace, .btn-lang { padding: 9px 12px; font-size: 0.85rem; }
    .register-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .navbar { padding: 8px 1rem; flex-wrap: wrap; gap: 8px; }
    .nav-title { display: none; }
    .tabs { flex-wrap: wrap; width: 100%; border-radius: 14px; }
    .tab { padding: 9px 14px; font-size: 0.85rem; flex: 1 1 auto; justify-content: center; }
    .login-layout { grid-template-columns: 1fr; }
    .login-decoration { display: none; }
    .login-form-area { padding: 2rem; }
    .register-meta { grid-template-columns: 1fr; }
    /* Audit A 4.3 : sur un écran de 360 px, 2rem de marge de carte et 18 px de
       marge de cellule ne laissaient pas la place aux noms arabes longs. */
    .card { padding: 1rem; }
    .ranking-table th, .ranking-table td { padding: 8px 10px; }
}

/* Audit A 4.3 : un tableau large défile DANS son cadre au lieu de faire
   déborder la page entière (liste des admis, emploi du temps, convocations). */
.table-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-scroll > .ranking-table { min-width: 100%; }

/* Fenêtre d'inscription : registre à venir, et avis qui remplace l'action de dépôt. */
.badge-upcoming {
    background: var(--gold-bg, #F5EFE0);
    color: var(--gold-dark, #8B6914);
    border: 1px solid var(--gold, #d4af37);
}
.avis-fenetre {
    background: #FBE9E7;
    border: 1px solid var(--danger, #c0392b);
    color: var(--danger, #c0392b);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Fil du parcours du candidat : quatre étapes, l'étape en cours, la consigne. */
.parcours {
    margin: 0 0 1.25rem;
}
.parcours-etapes {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0 0 0.75rem;
    padding: 0;
}
.parcours-etape {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    position: relative;
}
.parcours-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: var(--cream-dark);
    border: 2px solid var(--border);
    color: var(--text-muted);
}
.parcours-faite .parcours-num {
    background: var(--olive);
    border-color: var(--olive);
    color: var(--white);
}
.parcours-courante .parcours-num {
    background: var(--vert);
    border-color: var(--vert);
    color: var(--white);
    box-shadow: 0 0 0 4px var(--olive-pale);
}
.parcours-courante .parcours-libelle {
    color: var(--vert);
    font-weight: 700;
}
.parcours-consigne {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: var(--olive-pale);
    border: 1px solid var(--olive-light);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.6;
}
.parcours-icone {
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Visite guidée de la première visite. */
.guide-lanceur {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.tour-voile {
    position: fixed;
    inset: 0;
    background: transparent; /* capte le clic hors bulle ; l'assombrissement vient du halo */
    z-index: 1000;
}
.tour-halo {
    position: absolute;
    z-index: 1001;
    border-radius: 10px;
    box-shadow: 0 0 0 3px var(--gold), 0 0 0 9999px rgba(23, 61, 47, 0.55);
    pointer-events: none;
    transition: top .2s, left .2s, width .2s, height .2s;
}
.tour-bulle {
    position: absolute;
    z-index: 1002;
    background: var(--white);
    color: var(--text);
    border-radius: 12px;
    border-top: 4px solid var(--gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    padding: 14px 16px;
    max-width: calc(100vw - 32px);
}
.tour-compteur {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.tour-texte {
    margin: 0 0 12px;
    line-height: 1.7;
    font-size: 0.92rem;
}
.tour-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tour-nav {
    display: flex;
    gap: 6px;
}
@media (max-width: 480px) {
    .parcours-libelle {
        font-size: 0.68rem;
    }
}
.tour-bulle[dir="rtl"] .tour-compteur {
    text-align: right;
}
