/* 
 * Code Page: Authentification
 * Developer: Saidi Hamza
 * Description: Styling for the login/authentication page
 * Version: 1.0
 * Date: 2026-04-01
 */
.

/* ─── CSS Variables ─── */
:root {
    --background: #f7f9fb;
    --primary: #004ac6;
    --primary-container: #2563eb;
    --on-primary: #ffffff;
    --on-primary-container: #eeefff;
    --secondary: #495c95;
    --secondary-container: #acbfff;
    --on-secondary-container: #394c84;
    --surface: #f7f9fb;
    --surface-bright: #f7f9fb;
    --surface-dim: #d8dadc;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f2f4f6;
    --surface-container: #eceef0;
    --surface-container-high: #e6e8ea;
    --surface-container-highest: #e0e3e5;
    --on-surface: #191c1e;
    --on-surface-variant: #434655;
    --outline: #737686;
    --outline-variant: #c3c6d7;
    --inverse-surface: #2d3133;
    --inverse-on-surface: #eff1f3;
    --error: #ba1a1a;
    --on-error: #ffffff;
    --error-container: #ffdad6;
}

/* ─── Reset / Base ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--on-surface);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Top Nav ─── */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px rgba(25, 28, 30, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.top-nav .brand {
    font-family: 'Manrope', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #2563eb;
    text-decoration: none;
    letter-spacing: -0.02em;
}

#connexion-btn {
    background-color: #2563eb;
}

.top-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-nav .nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
}

.top-nav .nav-links a:hover {
    color: #2563eb;
    transform: scale(1.04);
}

.top-nav .btn-register {
    background: var(--primary-container);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.92;
}

.top-nav .btn-register:hover {
    transform: scale(1.05);
    opacity: 1;
}

/* ─── Main Split Layout ─── */
.main-split {
    flex: 1;
    display: flex;
    flex-direction: row;
    /* nav height */
    min-height: 100vh;
}

/* ─── Left Hero Panel ─── */
.hero-panel {
    display: none;
    position: relative;
    width: 50%;
    min-height: calc(100vh - 64px);
    overflow: hidden;
}

@media (min-width: 768px) {
    .hero-panel {
        display: flex;
    }
}

.hero-panel .hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('https://www.myedufrance.edufrance.education/front/media/img/cnnx2.png');
    background-size: cover;
    background-position: center;
}

.hero-panel .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 74, 198, 0.88) 0%, rgba(37, 99, 235, 0.62) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.hero-panel .hero-text {
    max-width: 480px;
    color: #fff;
}

.hero-panel .hero-text h1 {
    font-family: 'Manrope', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 1.25rem;
}

.hero-panel .hero-text p {
    font-size: 1.125rem;
    font-weight: 500;
    opacity: 0.92;
    line-height: 1.7;
    margin: 0;
    color: #eee;
}

/* ─── Right Form Panel ─── */
.form-panel {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--surface);
}

@media (min-width: 768px) {
    .form-panel {
        width: 50%;
        padding: 3rem 4rem;
    }
}

.form-card {
    width: 100%;
    max-width: 500px;
    background: var(--surface-container-lowest);
    border-radius: 0.75rem;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(25, 28, 30, 0.06);
}

/* Mobile brand */
.mobile-brand {
    display: block;
    text-align: center;
    margin-bottom: 2.5rem;
    font-family: 'Manrope', sans-serif;
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .mobile-brand {
        display: none;
    }
}

/* Card heading */
.card-heading {
    margin-bottom: 2.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .card-heading {
        text-align: left;
    }
}

.card-heading h2 {
    font-family: 'Manrope', sans-serif;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--on-surface);
    margin: 0 0 0.375rem;
    letter-spacing: -0.02em;
}

.card-heading p {
    font-size: 0.875rem;
    color: var(--on-surface-variant);
    margin: 0;
}

/* ─── Form Fields ─── */
.field-group {
    margin-bottom: 1.5rem;
}

.field-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--on-surface-variant);
    margin-bottom: 0.5rem;
    margin-left: 0.25rem;
}

.field-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.field-label-row .forgot {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    text-decoration: none;
}

.field-label-row .forgot:hover {
    text-decoration: underline;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--outline);
    font-size: 1.25rem;
    pointer-events: none;
    line-height: 1;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: var(--surface-container-lowest);
    border: 1.5px solid var(--outline-variant);
    border-radius: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    color: var(--on-surface);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(25, 28, 30, 0.05);
}

.form-input::placeholder {
    color: var(--outline);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 74, 198, 0.12);
}

/* Remember me */
.remember-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.25rem;
    margin-bottom: 1.5rem;
}

.remember-row input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 0.25rem;
    border: 1.5px solid var(--outline-variant);
    accent-color: var(--primary);
    cursor: pointer;
}

.remember-row label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--on-surface-variant);
    cursor: pointer;
    user-select: none;
}

/* Alert */
#alert {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--error);
    min-height: 0;
}

/* Submit button */
.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--primary-container);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.38);
}

.btn-login:active {
    transform: scale(0.97);
}

.btn-login .material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-size: 1.25rem;
    line-height: 1;
}

/* ─── Trust + register ─── */
.card-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1.5px solid var(--surface-container-high);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    margin-top: -1.5em;
    background: var(--surface-container-low);
    border-radius: 9999px;
}

.trust-badge .material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 0.875rem;
    color: var(--primary);
    line-height: 1;
}

.trust-badge span:last-child {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--on-surface-variant);
}

.register-hint {
    font-size: 0.875rem;
    color: var(--on-surface-variant);
}

.register-hint a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.register-hint a:hover {
    text-decoration: underline;
}

.privacy-link {
    margin-top: 1.5rem;
    text-align: center;
}

.privacy-link a {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--outline);
    text-decoration: none;
    transition: color 0.2s;
}

.privacy-link a:hover {
    color: var(--on-surface-variant);
}

/* ─── Footer ─── */
.site-footer {
    background: #f1f5f9;
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) {
    .site-footer {
        flex-direction: row;
    }
}

.site-footer .copyright {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
}

.site-footer .footer-links {
    display: flex;
    gap: 2rem;
}

.site-footer .footer-links a {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer .footer-links a:hover {
    color: #2563eb;
}

/* ─── Overlay (kept from original) ─── */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 40;
}

/* ─── reCAPTCHA ─── */
.g-recaptcha {
    margin-bottom: 1rem;
}

.recaptcha-container {
    display: flex;
    justify-content: center;
    overflow: hidden;
}

@media (max-width: 768px) {
    .g-recaptcha {
        transform: scale(0.75);
        transform-origin: center;
        background-color: transparent !important;
    }

    .form-panel {
        background-image: url('https://www.myedufrance.edufrance.education/front/media/img/cnnx2.png');
        background-size: cover;
        background-position: top;

    }

}

/* Ciblage mobile uniquement */
@media (max-width: 767px) {
    .form-input {
        background-color: transparent !important;
        border: 1px solid rgba(255, 255, 255, 0.3);
        /* Bordure semi-transparente pour la visibilité */
        color: #ffffff;
    }

    /* Style du placeholder en mode transparent */
    .form-input::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }

    /* Focus : on peut ajouter une bordure plus claire au clic */
    .form-input:focus {
        background-color: rgba(255, 255, 255, 0.1) !important;
        outline: none;
        border-color: #ffffff;
    }

    /* Si vous utilisez l'icône à l'intérieur, ajustez sa couleur si besoin */
    .input-icon {
        color: rgba(255, 255, 255, 0.8);
    }

    .form-card {
        width: 100%;
        max-width: 440px;
        background: #0000008c;
        border-radius: 0.75rem;
        padding: 2.5rem;
        box-shadow: 0 20px 40px rgba(25, 28, 30, 0.06);
    }

    .remember-row label {
        color: #eee;
    }

    .card-heading p,
    .card-heading h2,
    .field-label {
        color: #fff;
    }

    .trust-badge {
        background-color: transparent;
    }

    .trust-badge span:last-child {
        color: #fff;
    }
}

/* ======== END OF PAGE LOGIN ======== */