:root {
    --auth-accent: #4f46e5;
    --auth-accent-2: #3730a3;
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-line: #e2e8f0;
    --auth-bg: #f4f6fb;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body.auth-body {
    font-family: "Nunito", "Segoe UI", sans-serif;
    background: var(--auth-bg);
    color: var(--auth-ink);
}

.auth-split {
    min-height: 100%;
    display: grid;
    grid-template-rows: 180px 1fr;
}

.auth-visual {
    position: relative;
    overflow: hidden;
    background: #0f2744;
}

.auth-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 20%, rgba(15, 23, 42, 0.72) 100%);
}

.auth-visual-meta {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 16px;
    z-index: 1;
    color: #fff;
}

.auth-visual-meta strong {
    display: block;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.auth-visual-meta span {
    font-size: 0.85rem;
    opacity: 0.88;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 36px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.auth-logo img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 6px;
}

.auth-card h1 {
    margin: 0 0 6px;
    text-align: center;
    font-size: 1.7rem;
    letter-spacing: -0.03em;
}

.auth-card .lead {
    text-align: center;
    color: var(--auth-muted);
    margin: 0 0 22px;
    font-size: 0.95rem;
}

.auth-card label {
    display: block;
    font-weight: 700;
    font-size: 0.86rem;
    margin-bottom: 6px;
}

.auth-card .field { margin-bottom: 14px; }

.auth-card input[type="email"],
.auth-card input[type="text"],
.auth-card input[type="password"] {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 1rem;
    background: #fff;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-accent) 18%, transparent);
}

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

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 48px; }
.pass-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    min-width: 40px;
    min-height: 40px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 800;
}

.auth-submit {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    background: var(--auth-accent);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 6px;
}

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

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.auth-links a {
    color: var(--auth-accent);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.92rem;
}

.auth-links a:hover { text-decoration: underline; }

.auth-alert {
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 0.92rem;
}

.auth-alert.ok { background: #dcfce7; color: #166534; }
.auth-alert.bad { background: #fee2e2; color: #991b1b; }

.invalid-feedback { color: #dc2626; font-size: 0.85rem; display: block; margin-top: 4px; }

.auth-foot {
    text-align: center;
    margin-top: 28px;
    color: #94a3b8;
    font-size: 0.78rem;
}

@media (min-width: 900px) {
    .auth-split {
        grid-template-rows: none;
        grid-template-columns: 1.05fr 0.95fr;
        min-height: 100vh;
    }

    .auth-visual::after {
        background: linear-gradient(90deg, rgba(15, 23, 42, 0.05) 30%, rgba(15, 23, 42, 0.35) 100%);
    }

    .auth-visual-meta {
        left: 32px;
        bottom: 32px;
        right: 40px;
    }

    .auth-visual-meta strong { font-size: 1.6rem; }

    .auth-panel { padding: 40px; }
}
