/* =========================================================
   AUTH / LOGIN
========================================================= */

/* Page auth : pas de header, grille adaptée, main centré */
body.layout.page-auth .layout-header {
    display: none !important;
}

body.layout.page-auth {
    grid-template-rows: 1fr auto !important;
}

body.layout.page-auth .layout-main {
    padding-top: 0 !important;
    display: grid;
    place-items: start;
    min-height: 0;
}

body.layout.page-auth .page {
    padding: 0 !important;
}

/* Wrapper */
.auth {
    width: 100%;
}

.auth-container {
    width: 100%;
    max-width: 350px;
    padding: 0 var(--gutter-x);
    margin: 0 auto;
}

/* Card */
.auth-card {
    position: relative;
    /* nécessaire pour le bouton */
    border: 1px solid var(--border-color);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-top: 48px;
}

.auth-back {
    position: absolute;
    top: 12px;
    left: 12px;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    text-decoration: none;

    color: var(--muted);
    background: var(--surface-2);

    border: 1px solid var(--border-color);

    transition:
        background 140ms ease,
        color 140ms ease,
        transform 120ms ease;
}

/* hover */
.auth-back:hover {
    background: var(--accent-soft);
    color: var(--accent);
    transform: translateX(-2px);
}

/* focus clavier */
.auth-back:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.auth-head {
    text-align: center;
    margin-bottom: 14px;
}

.auth-logo {
    width: 100px;
    height: auto;
    display: block;
    margin: 0 auto 10px;
}

.auth-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.auth-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
}

/* Floating labels */
.auth-field {
    position: relative;
    margin-top: 12px;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 50px;
    padding: 16px 42px 6px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--surface-2);
    color: var(--text);
    outline: none;
    font: inherit;
    line-height: 1.2;
    transition: border-color 140ms ease, background 140ms ease;
}

.auth-input:focus {
    border-color: rgba(13, 110, 253, 0.65);
    background: var(--surface);
}

.auth-label {
    position: absolute;
    left: 12px;
    top: 15px;
    color: var(--muted);
    pointer-events: none;
    transition: top 140ms ease, font-size 140ms ease, opacity 140ms ease;
}

.auth-input:focus+.auth-label,
.auth-input:not(:placeholder-shown)+.auth-label {
    top: 6px;
    font-size: 0.78rem;
    opacity: 0.9;
}

/* Eye */
.auth-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 10px;
}

.auth-eye:hover {
    background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] .auth-eye:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Submit */
.auth-submit {
    width: 100%;
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--accent-border);
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-submit:hover {
    filter: brightness(0.9);
}

.auth-submit:focus-visible {
    outline: 2px solid var(--accent-focus);
    outline-offset: 2px;
}

/* Edge/IE: cache l’icône reveal native du champ password */
.auth-input::-ms-reveal,
.auth-input::-ms-clear {
    display: none;
}

/* Quand la hauteur est faible (paysage), on ARRÊTE le layout "sticky footer"
   pour éviter que le footer remonte dans le contenu. */
@media (max-height: 520px) and (max-width: 992px) {
    body.layout.page-auth {
        display: block !important;
        /* on sort du grid */
        min-height: auto !important;
    }

    body.layout.page-auth .layout-main {
        display: block !important;
        /* plus de centrage */
        padding: 12px var(--gutter-x) !important;
    }

    body.layout.page-auth .page {
        padding: 0 !important;
    }

    body.layout.page-auth .layout-footer {
        margin-top: 12px;
    }

    .auth-card {
        margin-top: 14px;
    }
}

/* Portrait smartphone : réduire les marges latérales */
@media (max-width: 575px) {
    body.layout.page-auth .auth-container {
        padding-left: 4px;
        padding-right: 4px;
    }

    .auth-card {
        margin-top: 14px;
    }
}