/* ============================================================
   Connect'Academia — Auth CSS (original design)
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body.auth-page,
body.auth-page html {
    height: 100%;
    background-color: #fff;
    overflow-x: hidden;
}

/* ── Layout principal ─────────────────────────────────────── */
.main-container {
    display: flex;
    min-height: 100vh;
}

/* ── Section gauche — image fixe ─────────────────────────── */
.image-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 48%;
    height: 100vh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 1;
}

.image-section--connexion {
    background-image: url('../images/auth-bg-connexion.png');
}

.image-section--inscription {
    background-image: url('../images/auth-bg-inscription.png');
}

/* ── Section droite — formulaire ─────────────────────────── */
.form-section {
    position: relative;
    flex: 1;
    margin-left: 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: white;
    z-index: 2;
    min-height: 100vh;
}

.form-section--scroll {
    justify-content: flex-start;
    padding-top: 40px;
    padding-bottom: 40px;
}

.form-wrapper {
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.form-content {
    width: 100%;
    max-width: 450px;
}

/* ── Logo ─────────────────────────────────────────────────── */
.logo-container,
.logo {
    margin-bottom: 25px;
    text-align: center;
}

.logo-container img,
.logo img {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ── Titres ───────────────────────────────────────────────── */
.title-small {
    font-size: 18px;
    color: #333;
    font-weight: 500;
    margin-bottom: 5px;
}

.title-main {
    font-size: 32px;
    font-weight: 800;
    text-transform: uppercase;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.step-text {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.form-section h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
    color: #1f2937;
    text-align: left;
    -webkit-text-fill-color: #1f2937;
}

.subtitle {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 30px;
    text-align: left;
}

/* ── Alertes PHP ──────────────────────────────────────────── */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}

.auth-alert--error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-alert--success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.auth-alert--warning {
    background: rgba(255, 171, 0, 0.10);
    color: #7A5200;
    border: 1px solid rgba(255, 171, 0, 0.28);
    border-left: 3px solid #FFAB00;
    flex-wrap: wrap;
    gap: 6px 8px;
    animation: alert-slide-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.auth-alert--warning .alert-icon {
    color: #FFAB00;
    flex-shrink: 0;
}

.auth-alert--warning .alert-message {
    flex: 1;
    font-weight: 500;
}

.auth-alert--warning .alert-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    color: #FFAB00;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: opacity 0.2s ease;
}

.auth-alert--warning .alert-link:hover {
    opacity: 0.75;
    text-decoration: underline;
}

@keyframes alert-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Input highlight on email duplicate */
.input-field--warning {
    border: 1.5px solid #FFAB00 !important;
    box-shadow: 0 0 0 3px rgba(255, 171, 0, 0.15) !important;
    background: rgba(255, 171, 0, 0.04) !important;
}

/* ── Champs de saisie ─────────────────────────────────────── */
.form-group {
    text-align: left;
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #000;
}

.form-group label span.required {
    color: #ef4444;
}

.input-wrapper {
    position: relative;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: none;
    background-color: #f3f4f6;
    font-size: 14px;
    outline: none;
    color: #1f2937;
    transition: background 0.3s;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group select:focus {
    background-color: #e5e7eb;
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-group input[readonly] {
    background-color: #e5e7eb;
    cursor: not-allowed;
}

.form-group input.has-eye {
    padding-right: 45px;
}

.form-group .field-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
    display: block;
}

/* ── Icône œil ────────────────────────────────────────────── */
.eye-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
}

.eye-icon:hover {
    color: #6366f1;
}

/* ── Toggle switch ────────────────────────────────────────── */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 30px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.switch input:checked + .slider {
    background: #7c3aed;
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
}

/* ── Boutons ──────────────────────────────────────────────── */
.btn-submit {
    width: 60%;
    padding: 12px;
    background-color: #f3f4f6;
    color: #9ca3af;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin: 0 auto;
    display: block;
    transition: background 0.2s, color 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-submit:hover {
    background-color: #7c3aed;
    color: #ffffff;
}

.btn-next {
    width: 100%;
    padding: 14px;
    background-color: #f3f4f6;
    color: #9ca3af;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-next:hover {
    background-color: #9b51e0;
    color: #ffffff;
}

/* ── Liens de bas de page ─────────────────────────────────── */
.footer-links {
    margin-top: 35px;
    text-align: center;
}

.link-gray {
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    display: block;
    margin-bottom: 15px;
}

.link-gray:hover {
    color: #7c3aed;
}

.signup-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.signup-text a {
    color: #c084fc;
    text-decoration: none;
    font-weight: 600;
}

.signup-text a:hover {
    text-decoration: underline;
}

.copyright {
    margin-top: 30px;
    color: #9ca3af;
    font-size: 12px;
}

/* ── Contraintes mot de passe ─────────────────────────────── */
.password-constraints {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.constraint {
    font-size: 12px;
    color: #d1d5db;
    display: flex;
    align-items: center;
}

.constraint::before {
    content: "✕";
    margin-right: 5px;
    font-size: 11px;
}

.constraint.ok {
    color: #10b981;
}

.constraint.ok::before {
    content: "✓";
}

/* ── Case à cocher ────────────────────────────────────────── */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 13px;
    color: #6b7280;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 400;
    color: #6b7280;
    cursor: pointer;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .image-section {
        display: none;
    }

    .form-section {
        margin-left: 0;
        flex: 1;
        padding: 20px;
    }

    .form-section--scroll {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .title-main { font-size: 24px; }
    .form-section { padding: 16px; }
}
