/*
 * Login, forgotten password and new password pages (layouts/auth.blade.php).
 * Kept apart from app-theme.css so these pages never depend on the main stylesheet
 * being up to date in a cache. Uses the design tokens defined in app-theme.css when present.
 */

/* Design tokens, repeated here so the page is complete on its own */
.auth-page {
    --c-primary: #0b6bcb;
    --c-danger: #c53030;
    --c-warning: #b7791f;
    --c-bg: #f4f6fa;
    --c-surface: #ffffff;
    --c-surface-2: #f8fafc;
    --c-border: #e3e8ef;
    --c-text: #1f2937;
    --c-muted: #6b7280;
    --c-hover-bg: #eef2f7;
    --c-hover-text: #111827;
    --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
}

body.dark-mode.auth-page {
    --c-primary: #4f9be8;
    --c-bg: #0f172a;
    --c-surface: #111827;
    --c-surface-2: #1f2937;
    --c-border: #2b3646;
    --c-text: #e5e7eb;
    --c-muted: #9ca3af;
    --c-hover-bg: #253247;
    --c-hover-text: #ffffff;
}

.auth-page a {
    color: var(--c-primary);
}

/* ---------- Authentication pages (login, forgotten / new password) ---------- */
.auth-page {
    --auth-brand-1: #064a78;
    --auth-brand-2: #0b6bcb;
    min-height: 100vh;
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(360px, 46%) 1fr;
    min-height: 100vh;
}

/* Brand panel */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.5rem 3rem;
    color: #fff;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .14) 0, transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(255, 255, 255, .10) 0, transparent 35%),
        linear-gradient(150deg, var(--auth-brand-1) 0%, var(--auth-brand-2) 100%);
    overflow: hidden;
}

.auth-brand-top {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.auth-logo {
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

.auth-brand-name {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.auth-brand-body h1 {
    font-size: clamp(1.6rem, 2.4vw, 2.3rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 0 0 .75rem;
    max-width: 18ch;
}

.auth-brand-body p {
    font-size: 1.05rem;
    opacity: .9;
    max-width: 42ch;
    margin-bottom: 1.75rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
    max-width: 46ch;
}

.auth-features li {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    line-height: 1.45;
    opacity: .95;
}

.auth-features i {
    flex: 0 0 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    font-size: .95rem;
}

.auth-brand-foot,
.auth-brand-foot a {
    font-size: .85rem;
    color: rgba(255, 255, 255, .8);
}

.auth-brand-foot a:hover {
    color: #fff;
}

/* Form side */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    gap: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 2.25rem 2rem;
}

.auth-card-head h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 .35rem;
}

.auth-card-head p {
    color: var(--c-muted);
    margin: 0 0 1.5rem;
}

.auth-card label {
    font-size: .875rem;
    margin-bottom: .35rem;
}

.auth-input {
    position: relative;
}

.auth-input > i {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-muted);
    pointer-events: none;
}

.auth-input .form-control {
    height: 3rem;
    padding-left: 2.6rem;
    border-radius: 10px;
    font-size: 1rem;
    background: var(--c-surface);
    color: var(--c-text);
    border-color: var(--c-border);
}

.auth-input .form-control:focus {
    border-color: var(--c-primary);
}

.auth-input .form-control.is-invalid {
    border-color: var(--c-danger);
    background-image: none;
}

.auth-input .auth-eye ~ .form-control,
.auth-input .form-control:not(:last-child) {
    padding-right: 3rem;
}

.auth-eye {
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.4rem;
    height: 2.4rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--c-muted);
}

.auth-eye:hover,
.auth-eye:focus {
    background: var(--c-hover-bg);
    color: var(--c-hover-text);
    outline: none;
}

.auth-error {
    margin-top: .4rem;
    font-size: .85rem;
    color: var(--c-danger);
}

.auth-caps {
    margin-top: .4rem;
    font-size: .8rem;
    color: var(--c-warning);
}

.auth-submit {
    height: 3rem;
    border-radius: 10px;
    font-weight: 600;
    margin-top: .5rem;
}

.auth-note {
    margin: 1.25rem 0 0;
    font-size: .82rem;
    color: var(--c-muted);
}

.auth-help {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem .6rem;
    font-size: .82rem;
    color: var(--c-muted);
    max-width: 420px;
    text-align: center;
}

body.dark-mode.auth-page {
    background: var(--c-bg);
}

body.dark-mode .auth-input .form-control {
    background: var(--c-surface-2);
}

body.dark-mode .auth-danger,
body.dark-mode .auth-error {
    color: #f87171;
}

/* Tablet and phone: the brand panel becomes a compact header */
@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .auth-brand {
        padding: 1.25rem 1.25rem 3.5rem;
        gap: .75rem;
    }

    .auth-brand-body h1 {
        font-size: 1.25rem;
        max-width: none;
        margin-bottom: .25rem;
    }

    .auth-brand-body p {
        font-size: .9rem;
        margin: 0;
    }

    .auth-features,
    .auth-brand-foot {
        display: none;
    }

    .auth-main {
        justify-content: flex-start;
        margin-top: -2.5rem;
        padding-top: 0;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
    }
}

/* Auth pages: corrections over AdminLTE dark mode and the overlapping card on phones */
body.dark-mode.auth-page,
body.dark-mode.auth-page .auth-main {
    background: var(--c-bg) !important;
}

.auth-page .auth-submit,
body.dark-mode.auth-page .auth-submit {
    background: #0b6bcb;
    border-color: #0b6bcb;
    color: #fff;
}

.auth-page .auth-submit:hover,
.auth-page .auth-submit:focus {
    background: #0957a6 !important;
    border-color: #0957a6 !important;
}

.auth-logo {
    border: 2px solid rgba(255, 255, 255, .55);
}

.auth-main {
    position: relative;
    z-index: 1;
}
