:root {
    --ink: #172033;
    --ink-muted: #5b687d;
    --surface: #fffdf9;
    --surface-soft: #f5f7fb;
    --line: #d8dee9;
    --danger: #a61b1b;
    --danger-surface: #fff1f0;
    --focus-ring: rgba(37, 99, 235, 0.24);
    --action-color: #174e91;
    --action-color-hover: #103d75;
    --card-radius: clamp(14px, var(--configured-radius, 18px), 24px);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--page-background, #eef2f7);
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--ink);
    background: var(--page-background, #eef2f7);
    font-family: "Inter", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

.video-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(145deg, #13213d, #273d61);
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
}

.video-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, rgba(5, 16, 36, 0.82) 0%, rgba(8, 23, 49, 0.62) 48%, rgba(7, 22, 46, 0.78) 100%),
        radial-gradient(circle at 78% 17%, rgba(65, 128, 217, 0.24), transparent 35%);
}

.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: 84px 24px 40px;
}

.back-to-store {
    position: absolute;
    top: 24px;
    left: 28px;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    color: #fff;
    background: rgba(7, 18, 38, 0.58);
    box-shadow: 0 8px 24px rgba(3, 12, 28, 0.18);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.back-to-store:hover {
    border-color: rgba(255, 255, 255, 0.68);
    color: #fff;
    background: rgba(7, 18, 38, 0.78);
    transform: translateX(-2px);
}

.back-to-store:focus-visible,
.login-card a:focus-visible,
.password-toggle:focus-visible,
.sign-in-button:focus-visible {
    outline: 3px solid #9fc4ff;
    outline-offset: 3px;
}

.sign-in-button:focus-visible {
    outline-color: #0b3b78;
    box-shadow: 0 0 0 3px #fff;
}

.login-card {
    width: min(100%, 468px);
    padding: clamp(28px, 5vw, 46px);
    border: max(1px, var(--configured-border-width, 1px)) var(--configured-border-style, solid) rgba(216, 222, 233, 0.92);
    border-radius: var(--card-radius);
    background: rgba(255, 253, 249, 0.975);
    box-shadow: 0 28px 80px rgba(3, 12, 28, 0.34), 0 3px 12px rgba(3, 12, 28, 0.18);
    animation: card-arrival 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-header {
    margin-bottom: 26px;
}

.access-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: #315071;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-transform: uppercase;
}

.access-eyebrow i {
    color: var(--primary-color, #1d4ed8);
    font-size: 1rem;
}

.login-header h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.65rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.16;
}

.login-intro {
    margin: 11px 0 0;
    color: var(--ink-muted);
    font-size: 0.91rem;
    line-height: 1.6;
}

.feedback {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 11px;
    margin: 0 0 22px;
    padding: 14px;
    border: 1px solid #f0b5b0;
    border-left: 4px solid #c9342f;
    border-radius: 9px;
    color: var(--danger);
    background: var(--danger-surface);
    font-size: 0.86rem;
    line-height: 1.45;
}

.feedback:focus {
    outline: 3px solid rgba(166, 27, 27, 0.22);
    outline-offset: 2px;
}

.feedback > i {
    margin-top: 1px;
    font-size: 1rem;
}

.feedback-title {
    margin: 0 0 3px;
    font-weight: 800;
}

.feedback ul {
    margin: 0;
    padding-left: 18px;
}

.feedback li + li {
    margin-top: 3px;
}

.login-form {
    display: grid;
    gap: 20px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field label,
.label-row label {
    margin: 0;
    color: #26354a;
    font-size: 0.86rem;
    font-weight: 750;
    line-height: 1.3;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.label-row a,
.legal-links a {
    color: #244d83;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(36, 77, 131, 0.3);
    text-underline-offset: 3px;
}

.label-row a:hover,
.legal-links a:hover {
    color: #12345f;
    text-decoration-color: currentColor;
}

.input-group-custom {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group-custom > i {
    position: absolute;
    left: 15px;
    z-index: 1;
    color: #748197;
    font-size: 1rem;
    pointer-events: none;
    transition: color 160ms ease;
}

.input-group-custom input {
    width: 100%;
    min-height: 52px;
    padding: 13px 15px 13px 44px;
    border: 1px solid #bdc7d4;
    border-radius: 10px !important;
    outline: none;
    color: var(--ink);
    background: #fff;
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.password-field input {
    padding-right: 58px;
}

.input-group-custom input::placeholder {
    color: #7a879a;
    opacity: 1;
}

.input-group-custom input:hover {
    border-color: #8997aa;
}

.input-group-custom input:focus {
    border-color: #2563b8;
    background: #fff;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.input-group-custom:focus-within > i {
    color: #1e56a0;
}

.password-toggle {
    position: absolute;
    right: 4px;
    z-index: 2;
    display: inline-grid;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    place-items: center;
    color: #536176;
    background: transparent;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}

.password-toggle:hover {
    color: #164d96;
    background: #edf3fb;
}

.sign-in-button {
    position: relative;
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 2px;
    padding: 13px 18px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 10px;
    color: #fff;
    background: var(--action-color);
    box-shadow: 0 8px 18px rgba(15, 51, 99, 0.2);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: filter 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.sign-in-button:hover:not(:disabled) {
    background: var(--action-color-hover);
    box-shadow: 0 11px 24px rgba(15, 51, 99, 0.28);
    transform: translateY(-1px);
}

.sign-in-button:active:not(:disabled) {
    transform: translateY(0);
}

.sign-in-button:disabled {
    cursor: wait;
    filter: saturate(0.72) brightness(0.9);
}

.button-arrow {
    font-size: 1rem;
    transition: transform 160ms ease;
}

.sign-in-button:hover:not(:disabled) .button-arrow {
    transform: translateX(2px);
}

.button-loading {
    display: none;
    align-items: center;
    gap: 9px;
}

.sign-in-button.is-loading .button-label,
.sign-in-button.is-loading .button-arrow {
    display: none;
}

.sign-in-button.is-loading .button-loading {
    display: inline-flex;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.login-footer {
    margin-top: 26px;
    padding-top: 21px;
    border-top: 1px solid #e1e6ed;
    text-align: center;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    color: #647186;
    font-size: 0.75rem;
    line-height: 1.5;
}

.security-note i {
    color: #3e6c59;
}

.legal-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 11px;
    color: #8792a2;
}

.legal-links a {
    font-size: 0.75rem;
    font-weight: 650;
}

@keyframes card-arrival {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 575.98px) {
    .video-background {
        position: fixed;
    }

    .login-shell {
        display: block;
        padding: 76px 12px 22px;
    }

    .back-to-store {
        top: 14px;
        left: 14px;
    }

    .login-card {
        margin: 0 auto;
        padding: 28px 20px 24px;
        border-radius: max(12px, var(--card-radius));
    }

    .login-intro {
        font-size: 0.875rem;
    }
}

@media (max-width: 350px) {
    .login-shell {
        padding-right: 8px;
        padding-left: 8px;
    }

    .login-card {
        padding-right: 16px;
        padding-left: 16px;
    }

    .label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-background video {
        display: none !important;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Professional split authentication layout. */
html, body { background: #fff; }
.login-shell { background: #fff; padding: 72px 24px 32px; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); width: min(1120px, 100%); min-height: 650px; overflow: hidden; border: 1px solid #e2e8f0; border-radius: var(--card-radius); background: #fff; box-shadow: 0 28px 80px rgba(15, 23, 42, .14); }
.auth-showcase { position: relative; min-height: 100%; overflow: hidden; background: var(--configured-header, #172554); }
.auth-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.auth-slide.is-active { opacity: 1; }
.auth-slide img { width: 100%; height: 100%; object-fit: cover; }
.auth-showcase::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,18,38,.08), rgba(7,18,38,.85)); }
.auth-showcase-copy { position: absolute; z-index: 2; left: clamp(24px, 5vw, 56px); right: clamp(24px, 5vw, 56px); bottom: clamp(28px, 6vw, 60px); color: #fff; }
.auth-showcase-copy span { font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.auth-showcase-copy h2 { margin: .7rem 0; color: #fff; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 800; }
.auth-showcase-copy p { max-width: 36rem; margin: 0; line-height: 1.65; }
.login-card { display: flex; width: 100%; max-width: none; min-width: 0; margin: 0; padding: clamp(30px, 5vw, 58px); flex-direction: column; justify-content: center; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.auth-logo { display: block; width: auto; max-width: 190px; max-height: 82px; margin: 0 auto 24px; padding: 10px 14px; object-fit: contain; object-position: center; border-radius: 8px; background: var(--configured-header, #172554); }
.back-to-store { color: #172033; background: #fff; border-color: #cbd5e1; box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.back-to-store:hover { color: #172033; background: #f8fafc; border-color: #94a3b8; }
@media (max-width: 820px) {
    .login-shell { display: block; padding: 72px 12px 24px; }
    .auth-split { grid-template-columns: 1fr; min-height: 0; margin: 0 auto; }
    .auth-showcase { min-height: 230px; }
    .auth-showcase-copy h2 { font-size: 2rem; }
    .auth-showcase-copy p { display: none; }
}
