/* === style.css - Design unifié et RTL === */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

:root {
    --primary: #004a80;
    --accent: #d4af37;
    --bg-light: #f4f7fa;
    --text-main: #2c3e50;
    --white: #ffffff;
    --border-color: #e1e8ed;
    --success: #27ae60;
    --danger: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: right;
    line-height: 1.6;
}

.main-header {
    background: var(--white);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo img {
    height: 60px;
}

.header-title h1 {
    font-size: 1.3rem;
    color: var(--primary);
    margin: 0;
}

.header-title small {
    color: #666;
    display: block;
    font-size: 0.9rem;
}

.navbar {
    background-color: var(--primary);
    padding: 12px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    padding: 5px 15px;
    border: 1px solid transparent;
    border-radius: 5px;
    transition: 0.3s;
}

.navbar a:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent);
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.login-container {
    max-width: 450px;
    margin: 80px auto;
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border-top: 5px solid var(--primary);
}

.page-title {
    text-align: center;
    margin-bottom: 30px;
}

.page-title h1 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.section-title {
    background: #f8fafd;
    padding: 12px 20px;
    border-radius: 6px;
    color: var(--primary);
    font-weight: bold;
    border-right: 4px solid var(--accent);
    margin: 30px 0 20px 0;
    font-size: 1.1rem;
}

.form-grid, .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.full-width {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #34495e;
    margin-bottom: 8px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fafbfc;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 74, 128, 0.1);
    background-color: var(--white);
}

input[readonly] {
    background-color: #eef2f5;
    color: #7f8c8d;
    cursor: not-allowed;
    border-color: #dde4e9;
}

.btn-submit {
    background-color: var(--primary);
    color: var(--white);
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    background-color: #003a66;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 74, 128, 0.2);
}

.btn-add {
    background: var(--success);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
}

.alert-success, .alert-danger {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
}

.alert-success { background: #d4edda; color: #155724; border-right: 4px solid #28a745; }
.alert-danger { background: #f8d7da; color: #721c24; border-right: 4px solid #dc3545; }
.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 5px; }

.score-box {
    background: #f0f7ff !important;
    font-weight: bold;
    font-size: 1.8em;
    color: var(--primary);
    text-align: center;
    border: 2px dashed var(--primary);
}

.univ-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    background: #f8fafd;
    padding: 15px;
    border-radius: 8px;
    align-items: center;
    border: 1px solid var(--border-color);
}

.info-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.info-item .label {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.info-item .value {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
}

.link-text { text-align: center; margin-top: 20px; }
.link-text a { color: var(--primary); font-weight: bold; text-decoration: none; }

@media(max-width:768px){
    .main-header { flex-direction: column; text-align: center; gap: 15px; }
    .header-logo { flex-direction: column; }
    .container { padding: 20px; margin: 20px; }
    .univ-row { flex-direction: column; }
}
/* === FENÊTRE MODALE DE CONFIRMATION === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-box {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-box h3 { color: var(--primary); margin-bottom: 15px; font-size: 1.4rem; font-weight: bold; }
.modal-box p { color: #555; margin-bottom: 25px; font-size: 1.1rem; line-height: 1.6; }

.modal-actions { display: flex; gap: 15px; justify-content: center; }

.btn-cancel {
    background: #95a5a6; color: white; padding: 12px 25px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.3s; font-family: inherit; font-size: 1rem;
}
.btn-confirm {
    background: var(--success); color: white; padding: 12px 25px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.3s; font-family: inherit; font-size: 1rem;
}

.btn-cancel:hover { background: #7f8c8d; }
.btn-confirm:hover { background: #219150; transform: translateY(-2px); }

/* === ASTÉRISQUE CHAMPS OBLIGATOIRES === */
.req-star {
    color: var(--danger);
    font-weight: bold;
    margin-right: 4px;
    font-size: 1.1em;
}