/* ================================================================
   AUTH_SHARED.CSS
   Fondations communes aux pages d'authentification : connexion/
   inscription (connect.css) et récupération de mot de passe
   (password_reset_styles.css). Palette, typographie, textures et
   composants (champs, boutons, indicateur de force du mot de passe)
   partagés pour que les trois écrans restent visuellement cohérents.
   ================================================================ */

:root {
    --auth-bg-1: #0a0d14;
    --auth-bg-2: #131a2a;
    --auth-bg-3: #0f121d;
    --auth-cyan: #7fd8ff;
    --auth-cyan-light: #b2eaff;
    --auth-violet: #a084e8;
    --auth-mint: #7be9c7;
    --auth-gold: #ffe082;
    --auth-ink: #e6e6fa;
    --auth-weak: #ff6b6b;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body.auth-body {
    font-family: 'EB Garamond', Georgia, serif;
    color: var(--auth-ink);
    background: linear-gradient(135deg, var(--auth-bg-1) 0%, var(--auth-bg-2) 52%, var(--auth-bg-3) 100%);
    overflow-x: hidden;
}

.auth-body a { color: var(--auth-gold); text-decoration: none; }
.auth-body a:hover { color: #fff3c4; text-decoration: underline; }
.auth-body ::selection { background: rgba(127, 216, 255, 0.3); }

/* === Texture nid d'abeille, en écho au menu-ruche du header === */
.hex-texture {
    position: absolute;
    inset: 0;
    opacity: 0.9;
    pointer-events: none;
    background-image:
        linear-gradient(30deg, rgba(127,216,255,0.05) 12%, transparent 12.5%, transparent 87%, rgba(127,216,255,0.05) 87.5%, rgba(127,216,255,0.05)),
        linear-gradient(150deg, rgba(127,216,255,0.05) 12%, transparent 12.5%, transparent 87%, rgba(127,216,255,0.05) 87.5%, rgba(127,216,255,0.05)),
        linear-gradient(30deg, rgba(127,216,255,0.05) 12%, transparent 12.5%, transparent 87%, rgba(127,216,255,0.05) 87.5%, rgba(127,216,255,0.05)),
        linear-gradient(150deg, rgba(127,216,255,0.05) 12%, transparent 12.5%, transparent 87%, rgba(127,216,255,0.05) 87.5%, rgba(127,216,255,0.05)),
        linear-gradient(60deg, rgba(160,132,232,0.035) 25%, transparent 25.5%, transparent 75%, rgba(160,132,232,0.035) 75%, rgba(160,132,232,0.035)),
        linear-gradient(60deg, rgba(160,132,232,0.035) 25%, transparent 25.5%, transparent 75%, rgba(160,132,232,0.035) 75%, rgba(160,132,232,0.035));
    background-size: 84px 146px;
    background-position: 0 0, 0 0, 42px 73px, 42px 73px, 0 0, 42px 73px;
}

.hex-bullet { flex-shrink: 0; display: inline-block; vertical-align: middle; }

@keyframes auth-shared--auth-orb-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes auth-shared--auth-form-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(10px); pointer-events: none; animation: auth-shared--auth-orb-float 9s ease-in-out infinite; }
.auth-form-in { animation: auth-shared--auth-form-in .7s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

/* === Alerte / message flash === */
.auth-alert {
    position: relative;
    max-width: 560px;
    margin: 0 auto 24px auto;
    padding: 14px 22px;
    background: linear-gradient(135deg, rgba(30,50,80,0.95) 0%, rgba(20,35,60,0.95) 100%);
    border: 1px solid rgba(255, 224, 130, 0.4);
    border-radius: 12px;
    color: var(--auth-gold);
    font-size: 15px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
}
.auth-alert.is-error { border-color: rgba(255, 107, 107, 0.5); color: #ffb3b3; }

/* === Retour à l'accueil (pastille flottante) === */
.auth-back-link {
    position: absolute;
    top: 32px;
    left: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    letter-spacing: .3px;
    color: var(--auth-cyan-light);
    background: rgba(15, 22, 36, 0.55);
    border: 1px solid rgba(127, 216, 255, 0.35);
    border-radius: 10px;
    backdrop-filter: blur(6px);
    transition: all .25s ease;
    z-index: 6;
}
.auth-back-link:hover { border-color: var(--auth-gold); color: var(--auth-gold); text-decoration: none; }

/* === Marque === */
.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    letter-spacing: 3px;
    font-variant-caps: small-caps;
    color: #fdf6ea;
    font-weight: 600;
}

/* === Onglets Connexion / Inscription === */
.auth-tabs { display: flex; gap: 32px; margin-bottom: 30px; border-bottom: 1px solid rgba(127,216,255,0.12); }
.auth-tab {
    appearance: none;
    background: none;
    border: none;
    padding: 0 0 14px 0;
    font-family: 'EB Garamond', serif;
    font-size: 14px;
    letter-spacing: 2px;
    font-variant-caps: small-caps;
    font-weight: 500;
    color: rgba(230,230,250,0.45);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color .25s ease, border-color .25s ease;
}
.auth-tab:hover { color: var(--auth-cyan-light); }
.auth-tab.is-active { color: var(--auth-ink); font-weight: 600; border-bottom-color: var(--auth-cyan); }
.auth-tabs.is-register-active .auth-tab.is-active { border-bottom-color: var(--auth-violet); }

/* === Champs de formulaire === */
.auth-field { margin-bottom: 18px; }
.auth-field label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: var(--auth-gold);
    margin-bottom: 8px;
}
.auth-field .field-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(20, 35, 60, 0.7);
    border: 1.5px solid rgba(127, 216, 255, 0.2);
    color: var(--auth-ink);
    border-radius: 12px;
    font-family: 'EB Garamond', serif;
    font-size: 16px;
    transition: all .25s ease;
}
.auth-field .field-input::placeholder { color: rgba(230,230,250,0.35); }
.auth-field .field-input:focus {
    outline: none;
    border-color: var(--auth-cyan-light);
    box-shadow: 0 0 0 3px rgba(127,216,255,0.15), 0 0 20px rgba(127,216,255,0.18);
    background: rgba(30,50,80,0.55);
}
.auth-field .field-hint { font-size: 12px; color: rgba(230,230,250,0.4); margin: 8px 0 0 0; }

/* Champ mot de passe avec bouton "afficher / masquer" (icône œil).
   .password-wrap n'entoure QUE l'input + le bouton (pas le label ni le
   texte d'aide en dessous) : le bouton se positionne en absolu par
   rapport à ce seul wrapper, jamais par rapport à tout le .auth-field. */
.password-wrap { position: relative; }
.password-wrap .field-input { padding-right: 46px; }
.password-toggle {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(230,230,250,0.5);
    cursor: pointer;
    transition: color .2s ease;
}
.password-toggle:hover { color: var(--auth-cyan-light); }
.password-toggle .eye-closed { display: block; }
.password-toggle .eye-open { display: none; }
.password-toggle.is-visible .eye-closed { display: none; }
.password-toggle.is-visible .eye-open { display: block; }

/* === Indicateur de force du mot de passe === */
.strength-meter { display: flex; gap: 5px; margin-top: 9px; }
.strength-bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(127,216,255,0.15); transition: background .25s ease; }
.strength-label { display: block; font-size: 12px; margin-top: 7px; min-height: 15px; transition: color .25s ease; }

/* === Boutons === */
.btn-auth-primary {
    width: 100%;
    padding: 16px 24px;
    border: none;
    color: #1a1833;
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .4px;
    border-radius: 12px;
    cursor: pointer;
    transition: all .35s ease;
    background: linear-gradient(135deg, var(--auth-mint) 0%, #5ac8b0 50%, var(--auth-violet) 100%);
    box-shadow: 0 4px 18px rgba(123,233,199,0.3);
}
.btn-auth-primary:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(123,233,199,0.35), 0 0 40px rgba(160,132,232,0.2); }
.btn-auth-primary.variant-register {
    background: linear-gradient(135deg, var(--auth-violet) 0%, #8f6fd8 50%, var(--auth-mint) 100%);
    box-shadow: 0 4px 18px rgba(160,132,232,0.3);
}
.btn-auth-primary.variant-register:hover { box-shadow: 0 10px 30px rgba(160,132,232,0.35), 0 0 40px rgba(123,233,199,0.2); }
.btn-auth-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; filter: none !important; }

.auth-divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; }
.auth-divider .line { flex: 1; height: 1px; background: rgba(127,216,255,0.15); }

.oauth-row { display: flex; gap: 14px; }
.btn-oauth {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 16px;
    border-radius: 12px;
    font-family: 'EB Garamond', serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all .25s ease;
}
.btn-oauth:hover { text-decoration: none; }
.btn-oauth.discord { background: rgba(88,101,242,0.14); border: 1.5px solid rgba(88,101,242,0.4); color: #c9ccff; }
.btn-oauth.discord:hover { border-color: rgba(88,101,242,0.7); background: rgba(88,101,242,0.22); }
.btn-oauth.google { background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.18); color: var(--auth-ink); }
.btn-oauth.google:hover { border-color: rgba(127,216,255,0.55); background: rgba(32,46,72,0.75); }

.auth-footer-note {
    text-align: center;
    font-size: 12.5px;
    color: rgba(230,230,250,0.4);
    letter-spacing: .3px;
}

.auth-legal { font-size: 12px; color: rgba(230,230,250,0.4); line-height: 1.5; margin: 0; }
.auth-legal a { font-size: 12px; }

/* === Panneau centré, simple (récupération de mot de passe) === */
.auth-simple-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow: hidden;
}
.auth-simple-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    z-index: 2;
    padding: 48px 44px 40px;
    background: linear-gradient(145deg, rgba(15,20,35,0.94) 0%, rgba(20,28,45,0.94) 100%);
    border: 1px solid rgba(127,216,255,0.16);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 50px rgba(127,216,255,0.07);
    backdrop-filter: blur(14px);
    overflow: hidden;
}
.auth-simple-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--auth-cyan), var(--auth-violet), var(--auth-cyan), transparent);
    opacity: 0.6;
}
.auth-simple-card .card-corner { position: absolute; z-index: 3; opacity: 0.7; }
.auth-simple-card .card-corner.top-left { top: 18px; left: 18px; }
.auth-simple-card .card-corner.bottom-right { bottom: 18px; right: 18px; }

.auth-logo-wrap { position: relative; display: flex; justify-content: center; margin-bottom: 26px; }
.auth-logo-wrap::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 170px; height: 170px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(127,216,255,0.26) 0%, rgba(160,132,232,0.13) 55%, transparent 75%);
    filter: blur(6px);
    z-index: 0;
}
.auth-logo-wrap img {
    position: relative;
    z-index: 1;
    width: 118px;
    height: auto;
    filter: drop-shadow(0 0 18px rgba(127,216,255,0.35));
}

.auth-simple-card h1 {
    font-size: 28px;
    font-weight: 600;
    color: #fdf6ea;
    margin: 0 0 10px 0;
    text-align: center;
    text-shadow: 0 0 24px rgba(127,216,255,0.25);
}
.auth-simple-card .lede {
    font-size: 15px;
    color: rgba(230,230,250,0.6);
    margin: 0 0 30px 0;
    line-height: 1.55;
    text-align: center;
}
.auth-simple-card .auth-tabs { border-bottom: none; margin-bottom: 8px; }

/* === Accessibilité === */
@media (prefers-reduced-motion: reduce) {
    .auth-body *, .auth-body *::before, .auth-body *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
.auth-body a:focus-visible,
.auth-body button:focus-visible,
.auth-body input:focus-visible {
    outline: 3px solid var(--auth-gold);
    outline-offset: 2px;
}
