/*
 * Public authentication pages (login, invitation, password reset…).
 *
 * Loaded on top of EasyAdmin's app.css so it can rely on EA's base reset,
 * typography and Bootstrap component classes (.form-control, .btn, .alert).
 *
 * Theming: these pages reuse EasyAdmin's own design tokens (the CSS variables
 * defined in EA's variables-theme.css) instead of a private palette, so the
 * public pages share the exact colours of the back-office — primary accent,
 * surfaces, text, borders and alerts — and follow EA's light/dark scheme
 * automatically (EA flips the same variables under .ea-dark-scheme).
 */

/* --- Turbo progress bar ------------------------------------------------- */
/* Turbo Drive's top loading bar defaults to a hardcoded blue; recolour it with
   EA's primary accent so it matches the theme (and its light/dark scheme). */
.turbo-progress-bar {
    background-color: var(--color-primary);
}

/* --- Background --------------------------------------------------------- */
body.ea.auth-body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-color);
    background:
        radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--color-primary) 12%, transparent) 0%, transparent 60%),
        var(--page-login-bg);
    background-attachment: fixed;
}

/* --- Layout / card ------------------------------------------------------ */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
    background: var(--page-login-form-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 2.25rem;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.75rem 1.4rem;
        border-radius: 14px;
    }
}

/* --- Branding header ---------------------------------------------------- */
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.5rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    color: var(--text-on-primary);
    background: var(--button-primary-bg);
}

.auth-logo svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-on-primary);
}

.auth-app-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-color);
}

.auth-subtitle {
    margin: 0 0 1.6rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-card > p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.auth-card .form-control-label,
.auth-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--form-label-color);
}

.auth-card .form-control-label.required::after {
    background: var(--color-primary);
}

.auth-card .form-control::placeholder {
    color: var(--text-muted);
}

/* --- Password show/hide toggle ------------------------------------------ */
/* The Stimulus "password-toggle" controller wraps a password input in
   .password-toggle and injects the eye button. Padding on the input keeps the
   typed value clear of the button. Uses EA's own tokens (mirrors the block in
   admin.css for the back-office side). */
.password-toggle {
    position: relative;
    display: block;
}

.password-toggle .form-control {
    padding-right: 2.75rem;
}

.password-toggle__btn {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0 8px 8px 0;
}

.password-toggle__btn:hover,
.password-toggle__btn:focus-visible {
    color: var(--color-primary);
}

.password-toggle__btn:focus-visible {
    outline: none;
    box-shadow: var(--form-input-hover-shadow);
}

.password-toggle__btn svg {
    width: 1.2rem;
    height: 1.2rem;
}

/* --- Links / footer ----------------------------------------------------- */
.auth-card a {
    color: var(--link-color);
    font-weight: 500;
    text-decoration: none;
}

.auth-card a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

/* --- Alerts (EA alert tokens) ------------------------------------------- */
.auth-card .alert {
    padding: 0.7rem 0.85rem;
    margin-bottom: 1.1rem;
    font-size: 0.875rem;
    border-radius: 10px;
    border: 1px solid transparent;
}

.auth-card .alert-success {
    color: var(--alert-success-color);
    background: var(--alert-success-bg);
    border-color: var(--alert-success-border-color);
}

.auth-card .alert-danger {
    color: var(--alert-danger-color);
    background: var(--alert-danger-bg);
    border-color: var(--alert-danger-border-color);
}

.auth-card .alert-warning {
    color: var(--alert-warning-color);
    background: var(--alert-warning-bg);
    border-color: var(--alert-warning-border-color);
}

.auth-card .alert-info {
    color: var(--alert-info-color);
    background: var(--alert-info-bg);
    border-color: var(--alert-info-border-color);
}

.auth-card .alert > div + div {
    margin-top: 0.2rem;
}
