/*
 * Page de connexion — feuille autonome, chargée par cette seule vue.
 *
 * La vue n'utilise plus la carte `login-box` d'AdminLTE : tout est défini ici,
 * sous le préfixe `.auth-*`, pour rester à l'écart des règles du thème.
 *
 * Parti pris : une seule teinte d'accent (gris ardoise), le reste en neutres.
 * Les propriétés logiques (`padding-inline`, `inset-inline-end`, `text-align: start`)
 * remplacent left/right : la page se retourne seule en arabe, sans règle RTL dédiée.
 */

:root {
    --auth-ink: #111827;
    --auth-ink-soft: #4b5563;
    --auth-muted: #9099a8;
    --auth-line: #e4e7ec;
    --auth-field: #d5d9e0;
    --auth-canvas: #f6f7f9;
    --auth-danger: #b42318;
}

body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 2rem 1rem;
    background-color: var(--auth-canvas);
    color: var(--auth-ink);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    width: 100%;
    max-width: 25rem;
}

/* ------------------------------------------------------------------ *
 * En-tête : marque discrète, sans image ni couleur vive.
 * ------------------------------------------------------------------ */

.auth-brand {
    margin-bottom: 1.75rem;
    text-align: center;
}

.auth-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: .875rem;
    border-radius: .75rem;
    background-color: var(--auth-ink);
    color: #fff;
    font-size: 1.05rem;
}

.auth-brand__name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.auth-brand__tagline {
    margin: .25rem 0 0;
    color: var(--auth-muted);
    font-size: .875rem;
}

/* ------------------------------------------------------------------ *
 * Carte
 * ------------------------------------------------------------------ */

.auth-card {
    padding: 1.75rem;
    border: 1px solid var(--auth-line);
    border-radius: .875rem;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
}

/* Erreur d'authentification : un liseré et un texte, pas de bandeau plein. */
.auth-alert {
    margin-bottom: 1.25rem;
    padding: .625rem .75rem;
    border: 1px solid #f0cfcb;
    border-radius: .5rem;
    background-color: #fdf5f4;
    color: var(--auth-danger);
    font-size: .8125rem;
    text-align: start;
}

/* ------------------------------------------------------------------ *
 * Champs
 * ------------------------------------------------------------------ */

.auth-field {
    margin-bottom: 1rem;
    text-align: start;
}

.auth-field__label {
    display: block;
    margin-bottom: .375rem;
    color: var(--auth-ink-soft);
    font-size: .8125rem;
    font-weight: 600;
}

.auth-field__control {
    position: relative;
}

.auth-input {
    display: block;
    width: 100%;
    height: 2.75rem;
    padding-inline: .875rem;
    border: 1px solid var(--auth-field);
    border-radius: .5rem;
    background-color: #fff;
    color: var(--auth-ink);
    font-family: inherit;
    font-size: .9375rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-input::placeholder {
    color: #b6bcc6;
}

.auth-input:focus {
    outline: 0;
    border-color: #98a1b0;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .06);
}

.auth-input.is-invalid {
    border-color: #dda29e;
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .1);
}

/* Le champ mot de passe réserve la place du bouton œil. */
.auth-input--with-toggle {
    padding-inline-end: 2.75rem;
}

.auth-toggle {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: 2.75rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--auth-muted);
    font-size: .875rem;
    cursor: pointer;
}

.auth-toggle:hover,
.auth-toggle:focus {
    color: var(--auth-ink-soft);
    outline: 0;
}

.auth-error {
    display: block;
    margin-top: .375rem;
    color: var(--auth-danger);
    font-size: .78125rem;
}

/* ------------------------------------------------------------------ *
 * Case « se souvenir de moi »
 * ------------------------------------------------------------------ */

.auth-remember {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .25rem 0 1.25rem;
    color: var(--auth-ink-soft);
    font-size: .8125rem;
    cursor: pointer;
}

.auth-remember input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--auth-ink);
    cursor: pointer;
}

/* ------------------------------------------------------------------ *
 * Bouton principal
 * ------------------------------------------------------------------ */

.auth-submit {
    display: block;
    width: 100%;
    height: 2.75rem;
    border: 0;
    border-radius: .5rem;
    background-color: var(--auth-ink);
    color: #fff;
    font-family: inherit;
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.auth-submit:hover {
    background-color: #1f2937;
}

.auth-submit:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .18);
}

/* ------------------------------------------------------------------ *
 * Comptes de démonstration (environnement local uniquement)
 * ------------------------------------------------------------------ */

.auth-demo {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-line);
}

.auth-demo__title {
    margin: 0 0 .625rem;
    color: var(--auth-muted);
    font-size: .75rem;
    text-align: center;
}

.auth-demo__list {
    display: flex;
    gap: .5rem;
}

.auth-demo__item {
    flex: 1;
    padding: .4375rem .25rem;
    border: 1px solid var(--auth-line);
    border-radius: .4375rem;
    background-color: #fafbfc;
    color: var(--auth-ink-soft);
    font-family: inherit;
    font-size: .75rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.auth-demo__item:hover {
    border-color: var(--auth-field);
    background-color: #f2f4f7;
}

/* ------------------------------------------------------------------ *
 * Pied : choix de la langue
 * ------------------------------------------------------------------ */

.auth-locales {
    margin: 1.25rem 0 0;
    color: var(--auth-muted);
    font-size: .8125rem;
    text-align: center;
}

.auth-locales a {
    color: var(--auth-muted);
    text-decoration: none;
}

.auth-locales a:hover {
    color: var(--auth-ink-soft);
    text-decoration: underline;
}

.auth-locales a.is-active {
    color: var(--auth-ink);
    font-weight: 600;
}

.auth-locales__sep {
    margin-inline: .5rem;
}
