:root {
    --primary-color: #6366f1;
    --secondary-color: #ec4899;
    --accent-color: #10b981;
    --neutral-color: #6b7280;
    --light-bg: #f8fafc;
    --dark-text: #1e293b;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    /*display: flex;
    flex-direction: column;*/
}
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
/* === FORMULAIRE INSCRIPTION ÉCOLE === */
.registration-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 160px);
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.registration-box {
    width: 100%;
    max-width: 520px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 2.25rem 2.25rem 2rem;
    box-shadow: 0 15px 40px -10px rgba(0,0,0,0.2);
    position: relative;
    border: 1px solid rgba(255,255,255,0.6);
}

.registration-logo {
    display: inline-block;
    line-height: 1;
}
.registration-logo img {
    display: block;
}

.registration-box .form-label {
    margin-bottom: 0.25rem;
    color: var(--dark-text);
}

.registration-box .form-control {
    border-radius: 10px;
    background: rgba(255,255,255,0.8);
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
}

.registration-box .form-control:focus {
    box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
    border-color: var(--primary-color);
}

.form-error {
    min-height: 18px;
}

@media (max-width: 576px) {
  .registration-box { padding: 1.75rem 1.5rem; }
  .registration-logo { font-size: 1.9rem; }
}

/* === STYLES HEADER === */
.navbar-brand {
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary-color) !important;
    text-decoration: none;
}

.navbar {
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.nav-link {
    color: var(--dark-text) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--primary-color);
    color: white !important;
    transform: translateY(-2px);
}

/* === STYLES GÉNÉRAUX === */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    border-radius: 10px;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.content-area {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    flex: 1;
    margin: 2rem 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.add-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.student-card {
    padding: 1.5rem;
    border-radius: 15px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.student-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.student-info {
    display: grid;
    grid-template-columns: 2fr 2fr 3fr 2fr auto auto;
    gap: 1rem;
    align-items: center;
}

/* Empêcher l'élargissement horizontal excessif du bloc nom + description dans l'espace entreprise */
.student-firstname {
    max-width: 280px; /* ajuste selon ta grille */
    overflow-wrap: anywhere; /* casse les très longues chaînes continues */
    word-break: break-word;
    white-space: normal; /* s'assure que le wrapping est activé */
}

/* Optionnel: limiter la hauteur avec défilement si descriptions très longues */
.student-firstname p {
    margin-bottom: 0.25rem;
    line-height: 1.25rem;
}

.action-btn {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.edit-btn {
    background: var(--accent-color);
    color: white;
}

.delete-btn {
    background: #ef4444;
    color: white;
}

.action-btn:hover {
    transform: scale(1.1);
}

/* Company list tweaks: center the send-access cell and put actions on the far right */
.company-card .student-info {
    /* name | email | send-access | actions */
    grid-template-columns: 2fr 3fr 2fr auto;
}
.company-card .send-access-cell {
    justify-content: center;
}
.company-card .student-actions {
    justify-self: end;
}

/* Keep grid alignment when description is empty */
.student-description:empty::before {
    content: '\00a0'; /* non-breaking space fallback */
    display: inline-block;
}

/* === STYLES FOOTER === */
.footer-area {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px 15px 0 0;
    padding: 3rem 0 2rem 0;
    margin-top: 4rem;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
    border-top: 3px solid var(--primary-color);
    min-height: 400px;
}

.footer-title {
    color: var(--dark-text);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-text {
    color: var(--neutral-color);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--neutral-color);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.stats-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    text-align: center;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
    color: white;
}

.footer-divider {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 2rem 0 1.5rem 0;
    opacity: 0.6;
}

/* Footer stats inline layout (moved from base template) */
.footer-area .stats-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
}
.footer-area .stats-row .stats-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 0.45rem 0.6rem;
    background: transparent;
    border-radius: 6px;
}
@media (max-width: 991px) {
    .footer-area .stats-row { flex-wrap: wrap; }
    .footer-area .stats-row .stats-card { min-width: 30%; margin-bottom: 0.5rem; }
}
.footer-area .footer-title { font-weight: 600; margin-bottom: .6rem; }
/* Keep contact column reasonable on large screens */
@media (min-width: 992px) {
    .footer-area .col-lg-2 { max-width: 16.666667%; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .student-info {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .content-area {
        padding: 1.5rem;
    }
}

/* === ÉLÉMENTS DÉCORATIFS === */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-element {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 70%;
    right: 10%;
    animation-delay: 2s;
}

.floating-element:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 50%;
    left: 80%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Forcer le backdrop Bootstrap derrière la modal (valeurs proches des défauts Bootstrap) */
.modal-backdrop {
    z-index: 1050 !important; /* Bootstrap default */
}
.modal {
    z-index: 1060 !important; /* Slightly above backdrop */
}
/* When modal is opened we want the page behind to be locked (Bootstrap default). Restoring hidden avoids backdrop layering issues. */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

/* Improve modal sizing so large forms fit better and reduce awkward double-scrolling */
.modal-dialog {
    max-width: 95vw;
}
.modal-xl {
    max-width: 1200px; /* larger but bounded */
}
.modal-body {
    /* allow modal body to scroll only if content exceeds viewport height */
    max-height: calc(100vh - 150px);
    overflow: auto;
}
