/* ====== RESET & BASE ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -1;
}

.skip-link:focus {
    left: 10px;
    top: 10px;
    width: auto;
    height: auto;
    padding: 8px 12px;
    background: #eaa401;
    color: #fff;
    border-radius: 4px;
    z-index: 10000;
    text-decoration: none;
}

/* ====== HEADER ====== */
header {
    background: linear-gradient(135deg, #1a3a6b 0%, #2d5a9e 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    height: 80px;
    cursor: pointer;
}

.logo img {
    height: 100%;
    width: auto;
    border-radius: 5px;
    max-width: 200px;
}

.school-title {
    text-align: center;
    margin: 20px 0;
    color: #1a3a6b;
    font-size: 1.5em;
}

/* ====== TICKER ====== */
.ticker {
    background: #ff6b6b;
    color: white;
    padding: 10px 16px;
    overflow: hidden;
    text-align: left;
    font-weight: 700;
    font-size: 1.15rem;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 10px;
}

.ticker .ticker-text {
    display: inline-block;
    padding-left: 100%;
    white-space: nowrap;
    animation: slide 40s linear infinite;
    will-change: transform;
}

@keyframes slide {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.ticker:hover .ticker-text {
    animation-play-state: paused;
}

/* ====== NAVIGATION ====== */
nav {
    background: #2c3e50;
    padding: 0;
    max-width: 1200px;
    margin: 20px auto;
    border-radius: 5px;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav li {
    position: relative;
}

nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    transition: background 0.3s ease;
    cursor: pointer;
}

nav a:hover {
    background: #1a3a6b;
}

nav li.active > a {
    background: #1a3a6b;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #34495e;
    min-width: 250px;
    flex-direction: column;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 0 0 5px 5px;
}

nav li:hover .submenu {
    display: flex;
}

.submenu li {
    width: 100%;
}

.submenu a {
    padding: 12px 15px;
    border-bottom: 1px solid #2c3e50;
}

.submenu a:last-child {
    border-bottom: none;
}

/* ====== PAGES ====== */
.page {
    display: none;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 40px;
    min-height: calc(100vh - 400px);
}

.page.active {
    display: block;
}

/* ====== ACCUEIL ====== */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

.carousel {
    position: relative;
    max-width: 100%;
    margin: auto;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.carousel-container {
    position: relative;
    width: 100%;
    padding-bottom: 50%;
    overflow: hidden;
}

.carousel-slide {
    display: none;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.carousel-slide.active {
    display: block;
}

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

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 16px 20px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 18px;
    transition: background 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(0,0,0,0.8);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.dot.active {
    background: white;
}

.dot:hover {
    background: rgba(255,255,255,0.8);
}

.page-title {
    margin: 20px 0 12px;
    color: #1a3a6b;
    font-size: 2.2rem;
}

.section-title {
    text-align: center;
    color: #1a3a6b;
    margin: 40px 0 30px;
    font-size: 1.5rem;
}

.section-subtitle {
    margin-top: 30px;
    color: #1a3a6b;
    font-size: 1.1rem;
}

.formations-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.formation-card {
    background: #f8f9fa;
    border-left: 5px solid #1a3a6b;
    padding: 20px;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.formation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.formation-card h3 {
    color: #1a3a6b;
    margin-bottom: 10px;
}

.formation-card p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

/* ====== FORMATIONS ====== */
.formations-container {
    margin: 40px 0;
}

.formations-type-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.formation-type-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 5px solid #1a3a6b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.formation-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.formation-type-card h3 {
    color: #1a3a6b;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.formation-type-card p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.formation-detail-page {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 10px;
    margin-bottom: 40px;
    border-left: 5px solid #1a3a6b;
}

.formation-detail-page img {
    max-width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 25px;
}

.formation-detail-page h2 {
    color: #1a3a6b;
    margin-bottom: 25px;
    font-size: 2em;
}

.formation-detail-page h3 {
    color: #1a3a6b;
    margin: 30px 0 15px;
    font-size: 1.3em;
}

.formation-detail-page p {
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 1.05em;
}

.formation-detail-page ul {
    margin-left: 25px;
    margin-bottom: 25px;
}

.formation-detail-page li {
    margin-bottom: 12px;
    line-height: 1.6;
}

/* ====== ADMISSION ====== */
.admission-content {
    margin-bottom: 40px;
}

.admission-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
}

.admission-article {
    background: #e8f4f8;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1em;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group input[type="file"] {
    padding: 8px;
}

.required::after {
    content: " *";
    color: red;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.phone-input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.phone-input-group select,
.phone-input-group input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1em;
}

.phone-input-group select {
    flex: 0 0 120px;
    max-width: 120px;
}

.phone-input-group input {
    flex: 1;
    min-width: 150px;
}

form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    max-width: 800px;
    margin: 0 auto;
}

/* ====== CONTACT ====== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    align-items: start;
}

.contact-box {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
}

.muted-label {
    color: #1a3a6b;
}

.alert-success {
    background: #d4edda;
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
    border-left: 5px solid #28a745;
    text-align: center;
}

.alert-success p {
    color: #155724;
    font-weight: bold;
}

/* ====== PAIEMENT ====== */
.payment-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
}

.payment-card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.alert-info {
    background-color: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #0c2340;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.candidate-info {
    background: #f9fafb;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.info-row p {
    margin: 0;
}

.info-row strong {
    color: #1e3a8a;
}

.payment-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.payment-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.payment-table th,
.payment-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.payment-table th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #1e3a8a;
}

.payment-table tr:hover {
    background-color: #f9fafb;
}

.payment-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f9fafb;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    color: #1e3a8a;
    margin-top: 15px;
}

.payment-methods {
    margin-top: 30px;
}

.payment-method {
    border: 2px solid #e5e7eb;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-method:hover {
    border-color: #3b82f6;
    background-color: #f0f9ff;
}

.payment-method input[type="radio"] {
    margin-right: 10px;
}

.payment-method label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    font-weight: 600;
}

.upload-section {
    margin-top: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 4px;
}

.bank-details {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
}

.bank-details h4 {
    color: #1e40af;
    margin-top: 0;
}

.bank-details p {
    margin: 8px 0;
    line-height: 1.6;
}

.steps {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 150px;
    text-align: center;
    padding: 15px;
    background: #f9fafb;
    border-radius: 4px;
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    line-height: 40px;
    font-weight: bold;
    margin-bottom: 10px;
}

.step.active .step-number {
    background: #10b981;
}

/* ====== BOUTONS ====== */
.btn {
    display: inline-block;
    background: #1a3a6b;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    font-size: 1em;
    font-weight: 600;
    margin: 5px;
}

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

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

.btn-primary {
    background: #ff6b6b;
}

.btn-primary:hover {
    background: #ff5252;
}

.btn-secondary {
    background: #ffffff;
    color: #1a3a6b;
    border: 1px solid rgba(0,0,0,0.08);
}

.btn-secondary:hover {
    background: #f0f0f0;
}

.btn-block {
    display: inline-block;
    margin-top: 16px;
}

.btn-back {
    background: #6c757d;
    margin-bottom: 20px;
}

.btn-back:hover {
    background: #5a6268;
}

/* ====== FOOTER ====== */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: left;
    margin-bottom: 30px;
}

.footer-section {
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    color: #ffffff;
}

.footer-section p {
    margin-bottom: 10px;
    font-size: 0.95em;
}

.footer-content a {
    color: white;
    text-decoration: none;
}

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

.copyright {
    border-top: 1px solid #444;
    padding-top: 20px;
    font-size: 0.9em;
}

/* ====== CLASSES UTILITAIRES ====== */
.hidden {
    display: none !important;
}

.ml-10 {
    margin-left: 10px;
}

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

a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(26,58,107,0.25);
    outline-offset: 2px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .logo {
        height: 60px;
    }

    .ticker {
        font-size: 0.9em;
        padding: 8px;
    }

    nav ul {
        flex-direction: column;
        align-items: stretch;
    }

    nav li {
        width: 100%;
    }

    nav a {
        padding: 12px 15px;
        font-size: 0.95em;
    }

    .submenu {
        position: static;
        display: none;
        background: #34495e;
        border-top: 1px solid #2c3e50;
    }

    nav li:active .submenu,
    nav li:focus-within .submenu {
        display: flex;
    }

    .submenu a {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .page {
        margin: 20px auto;
        padding: 0 20px;
    }

    .hero h1 {
        font-size: 1.5em;
        margin: 20px 0 15px;
    }

    .hero p {
        font-size: 0.95em;
    }

    .formations-list,
    .formations-type-container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 0;
    }

    .formation-card,
    .formation-type-card,
    .formation-detail-page {
        padding: 15px;
    }

    .formation-card h3,
    .formation-type-card h3,
    .formation-detail-page h2 {
        font-size: 1.1em;
    }

    .formation-card p,
    .formation-type-card p,
    .formation-detail-page p {
        font-size: 0.9em;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.95em;
        width: 100%;
        text-align: center;
    }

    .carousel-btn {
        padding: 12px 16px;
        font-size: 16px;
    }

    .carousel-container {
        padding-bottom: 60%;
    }

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

    .form-group label {
        font-size: 0.95em;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 1em;
    }

    form {
        padding: 20px;
        max-width: 100%;
    }

    footer {
        padding: 30px 15px;
        margin-top: 40px;
    }

    .footer-grid {
        gap: 20px;
    }

    .footer-section h4 {
        font-size: 0.95em;
    }

    .footer-section p {
        font-size: 0.85em;
    }

    .info-row {
        grid-template-columns: 1fr;
    }

    .payment-table {
        font-size: 12px;
    }

    .payment-table th,
    .payment-table td {
        padding: 8px;
    }

    .phone-input-group {
        flex-direction: column;
    }

    .phone-input-group select {
        flex: 0 0 auto;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .logo {
        height: 50px;
    }

    .ticker {
        font-size: 0.8em;
        padding: 6px;
    }

    .hero h1 {
        font-size: 1.3em;
    }

    .hero p {
        font-size: 0.9em;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .formation-card,
    .formation-type-card,
    .formation-detail-page {
        padding: 12px;
    }

    .carousel-btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    .carousel-dots {
        bottom: 10px;
    }

    .dot {
        width: 10px;
        height: 10px;
    }
}

/* ====== PAGE DE CONFIRMATION ET PAIEMENT ====== */
.confirmation-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.confirmation-header {
    margin-bottom: 40px;
}

.success-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 20px;
}

.confirmation-subtitle {
    font-size: 1.1em;
    color: #666;
    margin-top: 10px;
}

.confirmation-details {
    margin-bottom: 40px;
}

.detail-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 30px;
    border: 2px solid #e9ecef;
    display: inline-block;
    min-width: 300px;
}

.detail-card h3 {
    color: #1a3a6b;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.dossier-number {
    font-size: 2em;
    font-weight: bold;
    color: #ff6b6b;
    margin: 10px 0;
    letter-spacing: 2px;
}

.detail-card small {
    color: #666;
    font-style: italic;
}

.payment-section {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.payment-section h2 {
    color: #1a3a6b;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.payment-option {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 30px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.payment-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: #ff6b6b;
}

.option-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.option-header i {
    font-size: 2em;
    color: #ff6b6b;
}

.option-header h3 {
    color: #1a3a6b;
    margin: 0;
    font-size: 1.3em;
}

.payment-option p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-payment {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
}

.file-upload {
    margin-bottom: 20px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    display: block;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.file-upload-label:hover {
    border-color: #ff6b6b;
    background: #fff5f5;
}

.file-upload-label i {
    font-size: 2em;
    color: #ff6b6b;
    display: block;
    margin-bottom: 10px;
}

.file-name {
    margin-top: 10px;
    font-weight: bold;
    color: #1a3a6b;
}

.confirmation-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-back {
    background: #6c757d;
}

.btn-back:hover {
    background: #5a6268;
}

/* Animation pour les notifications */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ====== PAGE DE PAIEMENT ====== */
.payment-processing {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.payment-container {
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.payment-summary {
    background: #f8f9fa;
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
}

.summary-card h3 {
    color: #1a3a6b;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.summary-details p {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.summary-details strong {
    color: #1a3a6b;
}

.payment-form {
    padding: 40px;
}

.payment-notice {
    display: flex;
    align-items: center;
    background: #e8f8f0;
    border: 1px solid #d4edda;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.notice-icon {
    font-size: 2em;
    color: #28a745;
    margin-right: 20px;
}

.notice-content h4 {
    color: #155724;
    margin-bottom: 5px;
}

.notice-content p {
    color: #155724;
    margin: 0;
    opacity: 0.8;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.2em;
    width: 100%;
    margin-bottom: 15px;
}

.payment-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}