/* ==========================================================================
   Admin authentication pages (Login) — used by Views/Shared/_AuthLayout.cshtml
   ========================================================================== */

:root {
    --auth-navy-900: #0b1d38;
    --auth-navy-800: #0f2547;
    --auth-navy-700: #132e56;
    --auth-blue-600: #1a75bc;
    --auth-blue-500: #2b8ad6;
    --auth-blue-100: #e7f1fb;
    --auth-green-500: #7ec540;

    --auth-bg: #f3f6fb;
    --auth-surface: #ffffff;
    --auth-border: #e2e8f0;
    --auth-border-strong: #cbd5e1;
    --auth-text: #0f172a;
    --auth-text-muted: #64748b;
    --auth-text-soft: #94a3b8;

    --auth-danger: #dc2626;
    --auth-danger-bg: #fef2f2;
    --auth-danger-border: #fecaca;

    --auth-radius-lg: 28px;
    --auth-radius-md: 14px;
    --auth-radius-sm: 12px;

    --auth-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 24px 60px -18px rgba(15, 37, 71, .22);
    --auth-ring: 0 0 0 4px rgba(26, 117, 188, .14);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

.auth-body {
    min-height: 100vh;
    font-family: var(--app-font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--auth-text);
    background: var(--auth-bg);
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    position: relative;
    overflow-x: hidden;
}

/* ---------- Soft ambient background ---------- */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .55;
}

.auth-blob--one {
    width: 520px;
    height: 520px;
    top: -180px;
    right: -140px;
    background: #cfe3f7;
}

.auth-blob--two {
    width: 460px;
    height: 460px;
    bottom: -200px;
    left: -120px;
    background: #dcefcb;
}

/* ---------- Shell ---------- */
.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1120px;
    min-height: 660px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    background: var(--auth-surface);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
    animation: auth-rise .6s cubic-bezier(.2, .8, .2, 1) both;
}

/* ---------- Form side ---------- */
.auth-form-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px 28px;
}

.auth-form-inner {
    width: 100%;
    max-width: 380px;
    margin: auto;
}

.auth-logo {
    margin-bottom: 36px;
}

    .auth-logo img {
        display: block;
        max-width: 180px;
        max-height: 140px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

.auth-heading {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--auth-text);
    letter-spacing: -.01em;
}

.auth-subheading {
    margin: 0 0 32px;
    font-size: 15px;
    color: var(--auth-text-muted);
}

.auth-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 13px;
    color: var(--auth-text-soft);
}

/* ---------- Fields ---------- */
.auth-field {
    margin-bottom: 20px;
}

.auth-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--auth-text-soft);
    display: flex;
    pointer-events: none;
    transition: color .2s ease;
}

.auth-input {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 16px 0 48px;
    font: inherit;
    font-size: 15px;
    color: var(--auth-text);
    background: #f8fafc;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.auth-input--with-toggle {
    padding-right: 48px;
}

.auth-input::placeholder {
    color: var(--auth-text-soft);
}

.auth-input:hover {
    border-color: var(--auth-border-strong);
}

.auth-input:focus {
    background: #fff;
    border-color: var(--auth-blue-600);
    box-shadow: var(--auth-ring);
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--auth-blue-600);
}

/* Email / password are typed left-to-right */
.auth-input[type="email"],
.auth-input[type="password"],
.auth-input[data-ltr] {
    direction: ltr;
    text-align: left;
}

.auth-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px #f8fafc inset;
    -webkit-text-fill-color: var(--auth-text);
}

.auth-input.input-validation-error {
    border-color: var(--auth-danger);
    background: #fff;
}

    .auth-input.input-validation-error:focus {
        box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
    }

.auth-field-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--auth-danger);
}

    .auth-field-error:empty,
    .auth-field-error.field-validation-valid {
        display: none;
    }

/* Password visibility toggle */
.auth-toggle-password {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--auth-text-soft);
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease;
}

    .auth-toggle-password:hover {
        color: var(--auth-navy-700);
        background: #eef2f7;
    }

    .auth-toggle-password:focus-visible {
        outline: none;
        box-shadow: var(--auth-ring);
    }

    .auth-toggle-password .icon-eye-off,
    .auth-toggle-password.is-visible .icon-eye {
        display: none;
    }

    .auth-toggle-password.is-visible .icon-eye-off {
        display: block;
    }

/* ---------- Submit button ---------- */
.auth-submit {
    position: relative;
    width: 100%;
    height: 54px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-navy-700) 0%, var(--auth-blue-600) 100%);
    border: 0;
    border-radius: var(--auth-radius-sm);
    box-shadow: 0 10px 24px -10px rgba(19, 46, 86, .6);
    cursor: pointer;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

    .auth-submit::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%);
        transform: translateX(100%);
        transition: transform .7s ease;
    }

    .auth-submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 30px -12px rgba(19, 46, 86, .7);
    }

        .auth-submit:hover::after {
            transform: translateX(-100%);
        }

    .auth-submit:active {
        transform: translateY(0);
    }

    .auth-submit:focus-visible {
        outline: none;
        box-shadow: 0 0 0 4px rgba(26, 117, 188, .3);
    }

    .auth-submit .auth-submit-arrow {
        transition: transform .2s ease;
    }

    .auth-submit:hover .auth-submit-arrow {
        transform: translateX(-3px);
    }

    .auth-submit.is-loading {
        pointer-events: none;
        filter: saturate(.8);
        opacity: .9;
    }

        .auth-submit.is-loading .auth-submit-arrow {
            display: none;
        }

.auth-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}

.auth-submit.is-loading .auth-spinner {
    display: inline-block;
}

.auth-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 20px 0 0;
    font-size: 13px;
    color: var(--auth-text-soft);
}

    .auth-secure-note svg {
        color: var(--auth-green-500);
    }

/* ---------- Error banner ---------- */
.auth-alert {
    display: none;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    padding: 12px 14px;
    font-size: 14px;
    color: #991b1b;
    background: var(--auth-danger-bg);
    border: 1px solid var(--auth-danger-border);
    border-radius: var(--auth-radius-sm);
    animation: auth-slide-down .3s ease-out;
}

    .auth-alert.show {
        display: flex;
    }

    .auth-alert-icon {
        flex-shrink: 0;
        margin-top: 2px;
        color: var(--auth-danger);
    }

    .auth-alert-message {
        flex: 1;
    }

    .auth-alert-close {
        flex-shrink: 0;
        width: 24px;
        height: 24px;
        padding: 0;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: #b91c1c;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
        opacity: .7;
        transition: opacity .2s ease, background-color .2s ease;
    }

        .auth-alert-close:hover {
            opacity: 1;
            background: rgba(220, 38, 38, .08);
        }

.validation-summary-valid {
    display: none;
}

.validation-summary-errors {
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--auth-danger);
}

    .validation-summary-errors ul {
        margin: 0;
        padding: 0 18px 0 0;
    }

/* ---------- Visual side ---------- */
.auth-visual-side {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: #fff;
    background: radial-gradient(120% 90% at 0% 0%, #1d5a9c 0%, transparent 55%), radial-gradient(90% 80% at 100% 100%, #1a4b82 0%, transparent 60%), linear-gradient(160deg, var(--auth-navy-800) 0%, var(--auth-navy-900) 100%);
    overflow: hidden;
}

.auth-visual-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, .9);
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.auth-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--auth-green-500);
    box-shadow: 0 0 0 4px rgba(126, 197, 64, .2);
}

.auth-visual-title {
    margin: 20px 0 12px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.45;
    color: #fff;
}

.auth-visual-text {
    margin: 0 auto 28px;
    max-width: 360px;
    font-size: 15px;
    color: rgba(226, 236, 248, .75);
}

.auth-illustration {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1 / 1;
    margin: -8px auto -12px;
}

    .auth-illustration svg {
        display: block;
    }

.auth-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

    .auth-features li {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        font-size: 13px;
        color: rgba(255, 255, 255, .88);
        background: rgba(255, 255, 255, .06);
        border: 1px solid rgba(255, 255, 255, .1);
        border-radius: 999px;
    }

        .auth-features li svg {
            color: #9fd46b;
        }

/* ---------- Animations ---------- */
@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes auth-slide-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell,
    .auth-alert {
        animation: none;
    }

    .auth-submit,
    .auth-submit::after {
        transition: none;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 520px;
        min-height: 0;
    }

    .auth-visual-side {
        display: none;
    }

    .auth-form-side {
        padding: 40px 36px 24px;
    }
}

@media (max-width: 480px) {
    .auth-body {
        padding: 0;
        align-items: stretch;
        background: var(--auth-surface);
    }

    .auth-bg {
        display: none;
    }

    .auth-shell {
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-form-side {
        padding: 32px 20px 20px;
    }

    .auth-heading {
        font-size: 24px;
    }
}
