/*
 * ============================================================
 *  BETSCRIBE — Pages d'authentification
 *  (connexion, inscription, mot de passe oublié, réinitialisation,
 *   confirmation du mot de passe, vérification de l'e-mail)
 *
 *  Balisage autonome (.bsauth-*) : le site charge Bootstrap 5 alors que
 *  les anciennes vues utilisaient des classes Bootstrap 4 (input-group-
 *  prepend, custom-control...) et deux feuilles concurrentes en
 *  !important — d'où des champs découpés et des boutons démesurés.
 *  Le thème vitrine (betscribe-palette.css) force encore en !important
 *  le texte en blanc et les <span> en or : les couleurs sont donc
 *  réaffirmées ici avec la même force, uniquement sous .bsauth.
 * ============================================================
 */

.bsauth {
    --bsauth-bg: #222538;
    --bsauth-card: #2a2e47;
    --bsauth-field: #1c1f33;
    --bsauth-line: #3b4062;
    --bsauth-text: #eceef4;
    --bsauth-muted: #a3a8c3;
    --bsauth-gold: var(--bs-gold, #D4A017);
    --bsauth-gold-light: var(--bs-gold-light, #F0C040);
    --bsauth-ink: #1a1d2e;
    --bsauth-error: #ff8a7a;
    --bsauth-success: #7bd88f;

    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 140px 16px 80px;
    background:
        radial-gradient(circle at 50% 0%, rgba(212, 160, 23, 0.09), transparent 55%),
        var(--bsauth-bg);
    color: var(--bsauth-text) !important;
}

.bsauth-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px 28px;
    background: var(--bsauth-card);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

/* ── En-tête ─────────────────────────────────────────── */

.bsauth-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 26px;
}

.bsauth-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.12);
    border: 1px solid rgba(212, 160, 23, 0.4);
    color: var(--bsauth-gold) !important;
    font-size: 1.15rem;
}

.bsauth .bsauth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(212, 160, 23, 0.1);
    border: 1px solid rgba(212, 160, 23, 0.4);
    color: var(--bsauth-gold-light) !important;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.bsauth .bsauth-title {
    margin: 0 0 6px;
    color: #ffffff !important;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.bsauth .bsauth-sub {
    margin: 0;
    max-width: 34ch;
    color: var(--bsauth-muted) !important;
    font-size: 0.925rem;
    line-height: 1.5;
}

/* ── Messages ────────────────────────────────────────── */

.bsauth .bsauth-note {
    margin: 0 0 20px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--bsauth-text) !important;
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid rgba(212, 160, 23, 0.3);
}

.bsauth .bsauth-note--success {
    background: rgba(123, 216, 143, 0.08);
    border-color: rgba(123, 216, 143, 0.35);
}

/* ── Champs ──────────────────────────────────────────── */

.bsauth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}

.bsauth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.bsauth .bsauth-label {
    margin: 0;
    color: var(--bsauth-text) !important;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Le cadre est porté par le conteneur : icône, saisie et bouton « œil »
   forment un seul champ. */
.bsauth-control {
    position: relative;
    display: flex;
    align-items: center;
    height: 46px;
    background: var(--bsauth-field);
    border: 1px solid var(--bsauth-line);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bsauth-control:focus-within {
    border-color: var(--bsauth-gold);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.18);
}

.bsauth-control.is-invalid {
    border-color: var(--bsauth-error);
}

.bsauth-control.is-invalid:focus-within {
    box-shadow: 0 0 0 3px rgba(255, 138, 122, 0.18);
}

.bsauth .bsauth-control-icon {
    flex-shrink: 0;
    width: 42px;
    text-align: center;
    color: var(--bsauth-muted) !important;
    font-size: 0.875rem;
}

.bsauth .bsauth-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 12px 0 0;
    margin: 0;
    border: 0;
    outline: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: #ffffff !important;
    /* 16px : évite le zoom automatique de Safari iOS sur le champ */
    font-size: 16px;
    font-family: inherit;
}

.bsauth .bsauth-input::placeholder {
    color: rgba(236, 238, 244, 0.35);
}

.bsauth .bsauth-input[readonly] {
    color: var(--bsauth-muted) !important;
    cursor: default;
}

.bsauth .bsauth-input:-webkit-autofill,
.bsauth .bsauth-input:-webkit-autofill:hover,
.bsauth .bsauth-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bsauth-field) inset;
    -webkit-text-fill-color: #ffffff;
    caret-color: #ffffff;
    transition: background-color 9999s ease-out;
}

.bsauth .bsauth-eye {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0 10px 10px 0;
    background: transparent;
    color: var(--bsauth-muted) !important;
    cursor: pointer;
}

.bsauth .bsauth-eye:hover,
.bsauth .bsauth-eye:focus-visible {
    color: var(--bsauth-gold-light) !important;
    outline: 0;
}

.bsauth .bsauth-error {
    margin: 0;
    color: var(--bsauth-error) !important;
    font-size: 0.8rem;
    line-height: 1.4;
}

.bsauth .bsauth-hint {
    margin: 0;
    color: var(--bsauth-muted) !important;
    font-size: 0.8rem;
}

/* ── Ligne « se souvenir » / « mot de passe oublié » ── */

.bsauth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.bsauth .bsauth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--bsauth-text) !important;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.bsauth .bsauth-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--bsauth-gold);
    cursor: pointer;
}

/* ── Liens ───────────────────────────────────────────── */

.bsauth .bsauth-link {
    color: var(--bsauth-gold-light) !important;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.bsauth .bsauth-link:hover,
.bsauth .bsauth-link:focus-visible {
    color: #ffffff !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Bouton principal ────────────────────────────────── */

.bsauth .bsauth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    margin-top: 6px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: var(--bsauth-gold);
    color: var(--bsauth-ink) !important;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(212, 160, 23, 0.22);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.bsauth .bsauth-submit:hover {
    background: var(--bsauth-gold-light);
    box-shadow: 0 8px 22px rgba(212, 160, 23, 0.32);
}

.bsauth .bsauth-submit:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.bsauth .bsauth-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* La palette globale peint les <span> en or : or sur or dans le bouton. */
.bsauth .bsauth-submit span {
    color: var(--bsauth-ink) !important;
}

.bsauth-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(26, 29, 46, 0.3);
    border-top-color: var(--bsauth-ink);
    border-radius: 50%;
    animation: bsauth-spin 0.7s linear infinite;
}

@keyframes bsauth-spin {
    to { transform: rotate(360deg); }
}

/* ── Pied de carte ───────────────────────────────────── */

.bsauth .bsauth-foot {
    margin: 22px 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    text-align: center;
    color: var(--bsauth-muted) !important;
    font-size: 0.875rem;
}

.bsauth-inline-form {
    display: inline;
    margin: 0;
}

/* ── Petits écrans ───────────────────────────────────── */

@media (max-width: 480px) {
    .bsauth { padding: 110px 12px 56px; }
    .bsauth-card { padding: 28px 20px 22px; border-radius: 14px; }
    .bsauth .bsauth-title { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
    .bsauth-control, .bsauth .bsauth-submit { transition: none; }
    .bsauth-spinner { animation-duration: 1.6s; }
}
