/**
 * Pages d’authentification — connexion, inscription, mot de passe oublié
 * Fond gris clair, carte blanche, accents bordeaux C-CAMPUS (#9A0049)
 */
html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

body.tls-auth-page,
body.tls-auth-page * {
    box-sizing: border-box;
}

:root {
    --auth-bg: #f7fafc;
    --auth-bg-accent: rgba(154, 0, 73, 0.04);
    --auth-card: #ffffff;
    --auth-border: #e2e8f0;
    --auth-primary: #9a0049;
    --auth-primary-hover: #7a003b;
    --auth-text: #252b37;
    --auth-muted: #64748b;
    --auth-input-bg: #f8fafc;
    --auth-input-border: #e2e8f0;
    --auth-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 10px 40px -10px rgba(0, 0, 0, 0.08);
}

body.tls-auth-page {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    color: var(--auth-text);
    background: var(--auth-bg) !important;
    background-attachment: scroll !important;
}

body.tls-auth-page .container {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

@media (min-width: 640px) {
    body.tls-auth-page .container {
        padding: 1.5rem;
    }
}

@media (min-width: 768px) {
    body.tls-auth-page .container {
        padding: 2rem;
    }
}

/* Ancien dégradé plein écran → léger voile optionnel */
body.tls-auth-page .bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: -10;
    background:
        radial-gradient(ellipse 80% 50% at 100% 0%, var(--auth-bg-accent) 0%, transparent 50%),
        radial-gradient(ellipse 70% 45% at 0% 100%, var(--auth-bg-accent) 0%, transparent 45%),
        linear-gradient(180deg, var(--auth-bg) 0%, #f1f5f9 100%);
    pointer-events: none;
}

/* ----- Connexion, inscription & MDP oublié : fond uni bordeaux ----- */
body.tls-auth-page.tls-auth-page--login,
body.tls-auth-page.tls-auth-page--register,
body.tls-auth-page.tls-auth-page--lost-password {
    background: #9a0049 !important;
}

body.tls-auth-page.tls-auth-page--login .bg-gradient,
body.tls-auth-page.tls-auth-page--register .bg-gradient,
body.tls-auth-page.tls-auth-page--lost-password .bg-gradient {
    display: none !important;
}

body.tls-auth-page .blob {
    display: none;
}

body.tls-auth-page.tls-auth-page--login .login-site-footer__text,
body.tls-auth-page.tls-auth-page--register .login-site-footer__text {
    color: rgba(255, 255, 255, 0.88);
}

/* Liens sous la carte : texte lisible sur fond bordeaux */
body.tls-auth-page.tls-auth-page--login .glass-card .signup-text,
body.tls-auth-page.tls-auth-page--register .glass-card .signup-text {
    color: var(--auth-muted);
}

body.tls-auth-page.tls-auth-page--login .glass-card .signup-link,
body.tls-auth-page.tls-auth-page--register .glass-card .signup-link {
    color: var(--auth-primary);
}

body.tls-auth-page.tls-auth-page--login .glass-card .signup-link:hover,
body.tls-auth-page.tls-auth-page--register .glass-card .signup-link:hover {
    color: var(--auth-primary-hover);
    opacity: 1;
}

body.tls-auth-page.tls-auth-page--login .login-help-fab,
body.tls-auth-page.tls-auth-page--register .login-help-fab {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body.tls-auth-page.tls-auth-page--login .login-help-fab:hover,
body.tls-auth-page.tls-auth-page--register .login-help-fab:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

body.tls-auth-page .card-wrapper {
    width: 100%;
    max-width: 26rem;
    position: relative;
    z-index: 1;
    padding-bottom: 4.5rem;
}

body.tls-auth-page.tls-auth-page--lost-password .card-wrapper {
    max-width: 28rem;
    padding-bottom: 4.5rem;
}

body.tls-auth-page.tls-auth-page--register .card-wrapper {
    max-width: 28rem;
}

body.tls-auth-page .glass-card {
    position: relative;
    border-radius: 1.75rem;
    padding: 1.75rem 1.5rem 1.5rem;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    box-shadow: var(--auth-shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

@media (min-width: 640px) {
    body.tls-auth-page .glass-card {
        padding: 2.25rem 2rem 2rem;
    }
}

/* ----- En-tête marque (login & inscription) ----- */
body.tls-auth-page .header {
    text-align: center;
    margin-bottom: 1.5rem;
}

body.tls-auth-page .auth-header-logo {
    display: block;
    width: min(100%, 440px);
    height: auto;
    margin: 0 auto;
}

@media (min-width: 768px) {
    body.tls-auth-page .header {
        margin-bottom: 2rem;
    }
}

body.tls-auth-page .login-brand__name {
    color: var(--auth-primary);
}

body.tls-auth-page .login-slogan {
    color: #c9a227;
    text-shadow: none;
}

body.tls-auth-page .login-brand__mark svg circle {
    stroke: var(--auth-primary);
}

/* ----- Titres page mot de passe oublié ----- */
body.tls-auth-page.tls-auth-page--lost-password .header {
    text-align: center;
    margin-bottom: 2rem;
}

body.tls-auth-page .title {
    font-family: 'League Spartan', sans-serif;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
}

body.tls-auth-page .subtitle {
    color: var(--auth-muted);
    font-size: 0.875rem;
    font-family: 'Nunito', sans-serif;
    line-height: 1.5;
}

/* ----- Formulaires ----- */
body.tls-auth-page .form-group label {
    color: var(--auth-text);
}

body.tls-auth-page .input-icon {
    color: var(--auth-muted);
}

body.tls-auth-page input[type='email'],
body.tls-auth-page input[type='password'],
body.tls-auth-page input[type='text'] {
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    color: var(--auth-text);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.tls-auth-page input::placeholder {
    color: #94a3b8;
}

body.tls-auth-page input:focus {
    border-color: rgba(154, 0, 73, 0.45);
    box-shadow: 0 0 0 3px rgba(154, 0, 73, 0.12);
}

body.tls-auth-page .toggle-password {
    color: var(--auth-muted);
}

body.tls-auth-page .toggle-password:hover {
    color: var(--auth-primary);
}

body.tls-auth-page .checkbox-text {
    color: var(--auth-muted);
}

body.tls-auth-page .forgot-link {
    color: var(--auth-primary);
}

body.tls-auth-page .forgot-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* Bouton principal : blanc + bordure (maquette) */
body.tls-auth-page button[type='submit']:not(.login-help-fab):not(.toggle-password) {
    background: #ffffff;
    color: var(--auth-text);
    border: 1px solid var(--auth-input-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.tls-auth-page button[type='submit']:not(.login-help-fab):not(.toggle-password):hover {
    background: #fafafa;
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* Variante inscription : CTA bordeaux plein */
body.tls-auth-page.tls-auth-page--register button[type='submit'].tls-auth-btn-accent {
    background: var(--auth-primary);
    color: #fff;
    border: none;
}

body.tls-auth-page.tls-auth-page--register button[type='submit'].tls-auth-btn-accent:hover {
    background: var(--auth-primary-hover);
    box-shadow: 0 8px 24px rgba(154, 0, 73, 0.25);
}

body.tls-auth-page .divider-line {
    border-top-color: var(--auth-border);
}

body.tls-auth-page .divider-text {
    color: var(--auth-muted);
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
}

body.tls-auth-page .signup-text {
    color: var(--auth-muted);
}

body.tls-auth-page .signup-link {
    color: var(--auth-primary);
}

body.tls-auth-page .signup-link:hover {
    opacity: 1;
    color: var(--auth-primary-hover);
}

/* Erreurs (fond clair) */
body.tls-auth-page .error-box {
    display: none;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

body.tls-auth-page .error-box.show {
    display: flex;
}

body.tls-auth-page .error-text {
    color: #b91c1c;
}

body.tls-auth-page .error-box svg {
    color: #dc2626 !important;
}

/* Pied de page */
body.tls-auth-page .login-site-footer__text,
body.tls-auth-page .footer-text {
    color: var(--auth-muted);
}

/* FAB aide */
body.tls-auth-page .login-help-fab {
    border-color: var(--auth-border);
    background: var(--auth-card);
    color: var(--auth-primary);
    box-shadow: var(--auth-shadow);
}

body.tls-auth-page .login-help-fab:hover {
    background: #fdf2f8;
}

/* ----- Mot de passe oublié : succès (masqué à l’arrivée ; affiché seulement avec .show) ----- */
body.tls-auth-page .success-card {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    margin-top: 0;
    padding: 1.25rem 1rem;
    border-radius: 0.65rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

body.tls-auth-page .success-card.show {
    display: flex;
}

body.tls-auth-page .success-icon {
    color: #16a34a;
}

body.tls-auth-page .success-title {
    color: var(--auth-text);
}

body.tls-auth-page .success-text,
body.tls-auth-page .success-note {
    color: var(--auth-muted);
}

body.tls-auth-page .success-email {
    color: var(--auth-primary);
}

body.tls-auth-page .btn-return {
    background: #fff;
    border: 1px solid var(--auth-input-border);
    color: var(--auth-text);
}

body.tls-auth-page .btn-return:hover {
    background: #fafafa;
    border-color: #cbd5e1;
}

body.tls-auth-page .help-text {
    color: var(--auth-muted);
}

body.tls-auth-page .resend-link {
    color: var(--auth-primary);
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: auto;
    min-width: 0;
    display: inline;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    box-shadow: none;
}

body.tls-auth-page .resend-link:hover {
    color: var(--auth-primary-hover);
    background: none;
}

/* Grille prénom / nom */
body.tls-auth-page .tls-auth-name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

body.tls-auth-page .tls-auth-name-row input[type='text'] {
    padding-left: 1rem;
}

@media (max-width: 420px) {
    body.tls-auth-page .tls-auth-name-row {
        grid-template-columns: 1fr;
    }
}

body.tls-auth-page .tls-auth-terms {
    font-size: 0.8125rem;
    color: var(--auth-muted);
    line-height: 1.45;
}

body.tls-auth-page .tls-auth-terms a {
    color: var(--auth-primary);
    font-weight: 600;
}

/* ----- Mise en page formulaires (login / register) ----- */
body.tls-auth-page form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

body.tls-auth-page .login-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}

body.tls-auth-page .login-brand__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

body.tls-auth-page .login-brand__mark svg {
    display: block;
    color: var(--auth-primary);
}

body.tls-auth-page .login-brand__name {
    font-family: 'League Spartan', sans-serif;
    font-size: clamp(1.5rem, 4vw, 1.875rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-transform: lowercase;
    margin: 0;
}

body.tls-auth-page .login-slogan {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.5rem, 4.5vw, 1.85rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

body.tls-auth-page .remember-forgot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

body.tls-auth-page .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

body.tls-auth-page input[type='checkbox'] {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

body.tls-auth-page .password-wrapper input {
    padding-right: 3rem;
}

body.tls-auth-page .input-wrapper {
    position: relative;
}

body.tls-auth-page .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

body.tls-auth-page input[type='email'],
body.tls-auth-page input[type='password'],
body.tls-auth-page input[type='text'] {
    width: 100%;
    padding: 0.8rem 1rem;
    padding-left: 3rem;
    border-radius: 0.65rem;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    outline: none;
    transition: border-color 200ms, box-shadow 200ms;
}

body.tls-auth-page .toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 200ms;
}

body.tls-auth-page button[type='submit'],
body.tls-auth-page .btn-social {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.65rem;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: all 200ms;
}

body.tls-auth-page button[type='submit']:not(.login-help-fab):not(.toggle-password) {
    padding: 0.85rem 1rem;
    font-weight: 700;
}

body.tls-auth-page .divider {
    position: relative;
    margin: 1.5rem 0 1.25rem;
}

body.tls-auth-page .divider-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid var(--auth-border);
}

body.tls-auth-page .divider-wrapper {
    text-align: center;
}

body.tls-auth-page .divider-text {
    position: relative;
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
}

body.tls-auth-page .social-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

@media (max-width: 360px) {
    body.tls-auth-page .social-btns {
        grid-template-columns: 1fr;
    }
}

body.tls-auth-page .btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.7rem 0.75rem;
    font-size: 0.9375rem;
    background: #fff;
    border: 1px solid var(--auth-input-border);
    color: var(--auth-text);
}

body.tls-auth-page .btn-social:hover {
    background: #fafafa;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

body.tls-auth-page .signup-link-wrapper {
    text-align: center;
    margin-top: 1.5rem;
}

body.tls-auth-page .signup-text {
    font-size: 0.875rem;
    font-weight: 400;
}

body.tls-auth-page .signup-link {
    font-size: 0.875rem;
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

body.tls-auth-page .login-site-footer {
    position: fixed;
    bottom: 1rem;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
    pointer-events: none;
}

body.tls-auth-page .login-site-footer__text {
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: 'Nunito', sans-serif;
}

body.tls-auth-page .login-help-fab {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 3;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-family: 'League Spartan', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 200ms, transform 200ms;
}

body.tls-auth-page button.login-help-fab {
    appearance: none;
    font: inherit;
    padding: 0;
}

/* Lost password : champs */
body.tls-auth-page.tls-auth-page--lost-password input[type='email'],
body.tls-auth-page.tls-auth-page--lost-password input[type='text'] {
    padding: 0.75rem 1rem;
    padding-left: 3rem;
    border-radius: 0.5rem;
}

body.tls-auth-page.tls-auth-page--lost-password button[type='submit'] {
    border-radius: 0.5rem;
}

body.tls-auth-page.tls-auth-page--lost-password .footer {
    margin-top: 2rem;
    text-align: center;
}

body.tls-auth-page.tls-auth-page--lost-password .footer-text {
    color: rgba(255, 255, 255, 0.88);
}

body.tls-auth-page.tls-auth-page--lost-password .help-section {
    margin-top: 2.25rem;
}

body.tls-auth-page .hide {
    display: none !important;
}

/* Confirmation après inscription */
body.tls-auth-page .tls-auth-notice--success {
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: 0.65rem;
    font-size: 0.875rem;
    line-height: 1.5;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}
