:root {
    --primary-color: #000641;
    --primary-dark: #000641;
    --accent-orange: #F76B00;
    --bg-color: #f4f7fc;
    --card-bg: #ffffff;
    --text-main: #212529;
    --text-muted: #6c757d;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: #000641;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

/* Conteneur centré et adapté à toutes les tailles d’écran */
.auth-wrapper {
    width: 100%;
    max-width: 440px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-wrapper.signup-layout {
    max-width: 840px;
}

.auth-container {
    background: var(--card-bg);
    width: 100%;
    border-radius: 28px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    padding: 35px 30px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.form-box {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.form-box.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.session-conflict-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -8px 0 18px;
    padding: 12px 14px;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
}

.session-conflict-banner[hidden] {
    display: none;
}

.session-conflict-icon {
    display: grid;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: #ffedd5;
    color: #c2410c;
    font-weight: 800;
}

/* En-tête et icône : proportions adaptées à tous les appareils */
.form-header {
    text-align: center;
    margin-bottom: 25px;
}

.avatar-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(0, 6, 65, 0.08), rgba(255, 122, 0, 0.15));
    border: 2px solid rgba(255, 122, 0, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px auto;
    box-shadow: 0 10px 20px rgba(0, 6, 65, 0.08);
}

.avatar-icon svg {
    width: 36px;
    height: 36px;
    fill: var(--primary-color);
}

.login-avatar-icon {
    width: 92px;
    height: 92px;
    background: rgba(255, 122, 0, 0.08);
    border: 3px solid rgba(255, 122, 0, 0.9);
    box-shadow: 0 0 0 6px rgba(255, 122, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-avatar-icon svg {
    width: 56px;
    height: 56px;
    fill: var(--primary-color);
    display: block;
}

.form-header h2 {
    font-size: 1.7rem;
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.access-confirmation-message {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.access-confirmation-error {
    margin: 0 0 16px;
    color: #b42318;
    font-size: 0.88rem;
    line-height: 1.45;
}

.access-confirmation-error[hidden] {
    display: none;
}

.google-local-file-warning {
    margin-top: 14px;
    padding: 11px 13px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
}

.google-local-file-warning[hidden] {
    display: none;
}

/* Form Fields */
.input-group {
    margin-bottom: 18px;
}

.signup-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 15px;
}

.signup-grid > .required-fields-note,
.signup-grid > .signup-course-group,
.signup-grid > .signup-consent,
.signup-grid > .btn-submit {
    grid-column: 1 / -1;
}

.signup-grid > .input-group {
    min-width: 0;
}

.signup-password-error {
    margin-top: 7px;
    color: #b42318;
    font-size: 0.82rem;
    line-height: 1.4;
}

.signup-password-error[hidden] {
    display: none;
}

.signup-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.signup-consent input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--accent-orange);
}

.signup-consent a {
    color: var(--primary-color);
    font-weight: 700;
}

.signup-consent a:hover {
    color: var(--accent-orange);
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.required-fields-note {
    margin: -8px 0 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.input-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-field-wrapper svg:not(.toggle-password svg) {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: var(--transition);
    pointer-events: none;
}

.input-field-wrapper input,
.input-field-wrapper select {
    width: 100%;
    padding: 14px 45px 14px 48px; /* Espace pour les icônes à gauche et à droite */
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #f8fafc;
    transition: var(--transition);
    outline: none;
}

.input-field-wrapper input:focus,
.input-field-wrapper select:focus {
    border-color: var(--primary-color);
    background-color: #fff;
}

/* Bouton d’affichage du mot de passe */
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 4px;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--primary-color);
}

.forgot-pass {
    text-align: right;
    margin-top: -8px;
    margin-bottom: 20px;
}

.forgot-pass a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.forgot-pass a:hover {
    color: var(--accent-orange);
}

.login-home-link {
    margin-top: 16px;
    text-align: center;
}

.login-home-link a {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.login-home-link a:hover {
    color: var(--accent-orange);
}

/* Action Buttons */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: #000641;
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 6, 65, 0.25);
    transition: var(--transition);
}

.btn-submit:hover {
    background: #F76B00;
    transform: translateY(-2px);
    box-shadow: 0 14px 25px rgba(247, 107, 0, 0.3);
}

.btn-submit:active {
    background: #F76B00;
    transform: translateY(0);
}

.btn-submit:disabled,
.btn-submit:disabled:hover {
    background: #9aa3b2;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    body {
        min-height: 100svh;
        padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
    }

    .auth-wrapper.signup-layout {
        width: 100%;
        max-width: 440px;
        margin: 0 auto;
    }

    .auth-container {
        padding: clamp(22px, 5vw, 30px) clamp(18px, 4vw, 24px);
    }

    .signup-grid {
        grid-template-columns: 1fr;
    }

    .signup-grid > .required-fields-note,
    .signup-grid > .signup-course-group,
    .signup-grid > .signup-consent,
    .signup-grid > .btn-submit {
        grid-column: 1;
    }
}

/* Social Login Dividers */
.divider {
    text-align: center;
    position: relative;
    margin: 22px 0;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    background: var(--card-bg);
    padding: 0 12px;
    position: relative;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

/* Social Buttons */
.social-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
}

#googleSignInButton {
    width: 100%;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: var(--transition);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

.social-btn:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
    transform: translateY(-2px);
}

/* Switch Links */
.switch-text {
    text-align: center;
    margin-top: 22px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.switch-text a {
    color: var(--accent-orange);
    font-weight: 700;
    text-decoration: none;
    margin-left: 4px;
}

.switch-text a:hover {
    text-decoration: underline;
}

/* User Dashboard Profile View */
.profile-card {
    text-align: center;
}

.profile-avatar {
    width: 85px;
    height: 85px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-orange));
    color: white;
    font-size: 2.2rem;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px auto;
    box-shadow: 0 12px 25px rgba(0, 6, 65, 0.25);
}

.profile-info h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 4px;
    font-weight: 800;
}

.profile-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.btn-logout {
    background: #fff5f5;
    color: #e53e3e;
    border: 1.5px solid #fed7d7;
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
    transform: translateY(-2px);
}

/* Adaptation aux petits téléphones (iPhone SE, Galaxy 360px, etc.) */
@media (max-width: 420px) {
    body {
        padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
    }
    .auth-container {
        padding: 24px 16px;
        border-radius: 20px;
    }
    .form-header h2 {
        font-size: 1.5rem;
    }
    .avatar-icon {
        width: 70px;
        height: 70px;
    }
}
/* Style du champ de code de vérification */
#resetCodeForm .input-field-wrapper input[type="text"] {
    letter-spacing: 4px;
    font-weight: bold;
    text-align: center;
    font-size: 18px;
    color: #000641;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    transition: border-color 0.3s ease;
}

#resetCodeForm .input-field-wrapper input[type="text"]:focus {
    border-color: #000641;
    outline: none;
    background-color: #ffffff;
}
