/* static/css/style.css - Rewritten & Consolidated */
:root {
    --primary: #2563eb;
    --secondary: #f59e0b;
    --accent: #7e22ce;
    --dark: #1e293b;
    --light: #f8fafc;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --danger: #ef4444;
}


body {
    font-family: 'Open Sans', sans-serif;
    color: var(--dark);
    background-color: var(--light);
    line-height: 1.6;
    overflow-x: hidden; /* ADD THIS LINE */
}

img, svg, video, canvas { max-width: 100%; }
.container, .container-fluid { width: 100%; }
.row { --bs-gutter-x: 1.5rem; }
.login-page .password-field { position: relative; }
.login-page .password-field .form-control { padding-right: 2.75rem; }
.password-toggle { align-items: center; background: transparent; border: 0; color: #64748b; cursor: pointer; display: inline-flex; height: 2.5rem; justify-content: center; padding: 0; position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 2.25rem; }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--primary); outline: none; }
.password-icon { height: 1.05rem; width: 1.05rem; }
.password-icon-hide { display: none; }
.password-toggle.is-visible .password-icon-show { display: none; }
.password-toggle.is-visible .password-icon-hide { display: block; }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

/* === Header & Navbar === */
.header {
    transition: all 0.3s ease-in-out;
}
.top-bar {
    font-size: 0.9rem;
}
.header .navbar-nav .nav-link {
    font-weight: 600;
    color: var(--dark);
    position: relative;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}
.header .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    left: 1rem;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}
.header .navbar-nav .nav-link:hover::after,
.header .navbar-nav .nav-link.active::after {
    width: calc(100% - 2rem);
}
.header .navbar-nav .nav-link.active {
    color: var(--primary);
}
.navbar-brand img {
    transition: transform 0.3s ease;
}
.navbar-brand:hover img {
    transform: scale(1.05);
}

/* === Hero Section === */
.hero {
    background: #2563eb;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
    min-height: 600px;
}
.bounce {
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

/* === General Sections & Components === */
section {
    padding: 80px 0;
}
section[id] {
    scroll-margin-top: 130px;
}
.page-title {
    padding-top: 4rem;
    padding-bottom: 4rem;
    background: #2563eb;
    color: white;
    position: relative;
    overflow: hidden;
}
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}
.btn.rounded-pill {
    transition: all 0.3s ease;
}
.btn.rounded-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.stats-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}
.testimonial-card {
    border-left: 4px solid var(--primary);
}

/* === Inscription Form === */
.form-step { display: none; }
.form-step.active { display: block; animation: fadeIn 0.5s; }
.progress-bar { transition: width 0.5s ease; }
.required-field::after { content: " *"; color: var(--danger); }
.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
}
.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === Gallery === */
.gallery-filter.active {
    background-color: var(--primary) !important;
    color: white !important;
}
.gallery-container a {
    position: relative;
    display: block;
}
.gallery-container .gallery-overlay {
    transition: background-color 0.3s ease;
}
.gallery-container a:hover .gallery-overlay {
    background-color: rgba(37, 99, 235, 0.7) !important;
}
.gallery-container a:hover .gallery-overlay i {
    opacity: 1 !important;
}

/* === Footer === */
.footer-brand img {
    filter: brightness(0) invert(1);
}

/* === Back to Top Button === */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: none;
}
#back-to-top.show {
    display: flex;
}

/* === Dashboard Cards (Parent/Student) === */
.dashboard-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 15px;
}
.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.cta-actions .btn { margin: 0 !important; }

@media (max-width: 991.98px) {
    section { padding: 3.5rem 0; }
    .hero { background-attachment: scroll; min-height: 520px; }
    .navbar { padding-bottom: .75rem !important; padding-top: .75rem !important; }
    .navbar-brand img { height: 42px; width: auto; }
    .navbar-collapse { border-top: 1px solid #e5e7eb; margin-top: .75rem; padding-top: .75rem; }
    .navbar-nav .nav-link { padding: .65rem .25rem; }
    .navbar-collapse > .d-flex { align-items: stretch !important; flex-direction: column; gap: .5rem; }
    .navbar-collapse > .d-flex .btn { margin-left: 0 !important; width: 100%; }
    .dropdown-menu { border: 1px solid #e5e7eb !important; box-shadow: none !important; }
    .hero-actions, .cta-actions { gap: .75rem; }
}

@media (max-width: 575.98px) {
    .container { padding-left: 1rem; padding-right: 1rem; }
    section { padding: 2.75rem 0; }
    .page-title { padding-bottom: 2.5rem; padding-top: 2.5rem; }
    h1.display-1, h1.display-2, h1.display-3, h1.display-4 { font-size: 2.15rem; }
    h2.display-5, h2.display-6 { font-size: 1.65rem; }
    .btn { max-width: 100%; white-space: normal; }
    .login-page { padding-bottom: 2rem !important; padding-top: 2rem !important; }
    .login-page .card-body { padding: 1.5rem !important; }
    .stats-number { font-size: 2.25rem; }
    .table-responsive { -webkit-overflow-scrolling: touch; }
    .hero {
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center top;
        min-height: 620px;
    }
    .hero-actions, .cta-actions { flex-direction: column; gap: .85rem; width: 100%; }
    .hero-actions .btn, .cta-actions .btn { margin: 0 !important; width: min(100%, 320px); }
}