:root {
    color-scheme: dark;
    --navy-950: #020914;
    --navy-900: #061326;
    --navy-800: #09203c;
    --cyan: #1aa7ff;
    --cyan-bright: #6fd2ff;
    --silver: #eaf3fb;
    --muted: #8fa7bd;
    --danger: #ff6f7d;
    --danger-bg: rgba(101, 18, 31, .54);
    --panel: rgba(4, 15, 29, .78);
    --line: rgba(141, 198, 235, .18);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: hidden;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--silver);
    background: var(--navy-950) url("assets/cinema-background.webp") center / cover fixed no-repeat;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 50% 38%, rgba(4, 15, 31, .18), rgba(0, 5, 12, .64) 72%),
        linear-gradient(90deg, rgba(0, 5, 13, .22), rgba(0, 8, 20, .08) 48%, rgba(0, 5, 13, .22));
    pointer-events: none;
}

.page-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 36px 20px 68px;
    isolation: isolate;
}

.ambient {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .25;
    pointer-events: none;
}

.ambient-one {
    width: 340px;
    height: 340px;
    top: 14%;
    left: 42%;
    background: #0077ff;
}

.ambient-two {
    width: 250px;
    height: 250px;
    right: 13%;
    bottom: 7%;
    background: #00b7ff;
    opacity: .13;
}

.login-card {
    width: min(100%, 470px);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(151, 208, 244, .24);
    border-radius: 26px;
    padding: 28px 34px 22px;
    background:
        linear-gradient(145deg, rgba(13, 34, 59, .85), rgba(2, 10, 21, .88)),
        var(--panel);
    box-shadow:
        0 34px 90px rgba(0, 0, 0, .52),
        0 0 0 1px rgba(255, 255, 255, .025) inset,
        0 0 75px rgba(20, 137, 255, .11);
    backdrop-filter: blur(20px) saturate(125%);
    -webkit-backdrop-filter: blur(20px) saturate(125%);
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0 18% auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan-bright), transparent);
    box-shadow: 0 0 25px rgba(60, 181, 255, .8);
}

.login-card::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -130px;
    top: -130px;
    border-radius: 50%;
    background: rgba(18, 132, 255, .16);
    filter: blur(22px);
    pointer-events: none;
}

.brand-block {
    position: relative;
    z-index: 1;
    text-align: center;
}

.brand-logo {
    display: block;
    width: min(100%, 325px);
    max-height: 225px;
    object-fit: contain;
    margin: -21px auto -14px;
    filter: drop-shadow(0 13px 25px rgba(0, 0, 0, .38)) drop-shadow(0 0 17px rgba(0, 139, 255, .2));
    mix-blend-mode: screen;
}

.brand-tagline {
    margin: 0;
    color: #b7c8d8;
    font-size: .69rem;
    line-height: 1.4;
    letter-spacing: .31em;
    font-weight: 650;
    text-transform: uppercase;
}

.divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 20px 0 18px;
}

.divider::before, .divider::after {
    content: "";
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line));
}

.divider::after { background: linear-gradient(90deg, var(--line), transparent); }

.divider span {
    width: 6px;
    height: 6px;
    transform: rotate(45deg);
    border: 1px solid rgba(86, 195, 255, .75);
    background: rgba(20, 143, 255, .42);
    box-shadow: 0 0 12px rgba(25, 159, 255, .7);
}

.login-section { position: relative; z-index: 1; }

.eyebrow {
    margin: 0 0 7px;
    color: var(--cyan-bright);
    font-size: .66rem;
    font-weight: 750;
    letter-spacing: .22em;
}

h1 {
    margin: 0;
    max-width: 360px;
    font-size: clamp(1.38rem, 4vw, 1.78rem);
    line-height: 1.18;
    letter-spacing: -.025em;
    font-weight: 650;
}

.intro {
    margin: 10px 0 20px;
    color: var(--muted);
    font-size: .87rem;
    line-height: 1.58;
}

.alert {
    display: none;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 13px;
    border: 1px solid rgba(255, 111, 125, .35);
    border-radius: 12px;
    background: var(--danger-bg);
    color: #ffd8dc;
    font-size: .79rem;
    line-height: 1.45;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .16);
}

.alert.is-visible { display: flex; animation: alertIn .35s ease both; }
.alert svg { flex: 0 0 18px; width: 18px; fill: var(--danger); margin-top: 1px; }

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-7px); }
    to { opacity: 1; transform: translateY(0); }
}

.field-group { margin-bottom: 15px; }

label {
    display: inline-block;
    margin: 0 0 7px 2px;
    color: #c8d6e3;
    font-size: .79rem;
    font-weight: 620;
}

.input-wrap { position: relative; }

.input-wrap > svg {
    position: absolute;
    z-index: 2;
    left: 14px;
    top: 50%;
    width: 18px;
    transform: translateY(-50%);
    fill: #708ca5;
    pointer-events: none;
    transition: fill .2s ease;
}

input {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 44px;
    border: 1px solid rgba(135, 177, 208, .21);
    border-radius: 13px;
    outline: none;
    background: rgba(1, 9, 20, .68);
    color: #f6fbff;
    font: inherit;
    font-size: .9rem;
    box-shadow: 0 1px 0 rgba(255,255,255,.025) inset;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input::placeholder { color: #587087; }

input:focus {
    border-color: rgba(54, 174, 255, .7);
    background: rgba(2, 14, 29, .85);
    box-shadow: 0 0 0 4px rgba(19, 142, 242, .12), 0 0 24px rgba(12, 134, 239, .08);
}

.input-wrap:focus-within > svg { fill: #46bdff; }

input.is-invalid { border-color: rgba(255, 111, 125, .68); }

.password-toggle {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 9px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    color: #7e99b1;
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover { background: rgba(255,255,255,.05); }
.password-toggle svg { width: 19px; fill: currentColor; }
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }

.field-error {
    display: none;
    margin: 6px 0 0 2px;
    color: #ff9ca6;
    font-size: .72rem;
}

.field-error.is-visible { display: block; }

.login-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    margin-top: 5px;
    overflow: hidden;
    border: 1px solid rgba(112, 211, 255, .54);
    border-radius: 13px;
    color: white;
    background: linear-gradient(135deg, #0871d9, #0ca9ee 55%, #0975d6);
    box-shadow: 0 13px 30px rgba(0, 116, 224, .28), 0 1px 0 rgba(255,255,255,.35) inset;
    font: inherit;
    font-size: .86rem;
    font-weight: 720;
    letter-spacing: .025em;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.login-button::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-110%);
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.27), transparent 70%);
    transition: transform .65s ease;
}

.login-button:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 16px 36px rgba(0, 116, 224, .35); }
.login-button:hover::before { transform: translateX(110%); }
.login-button:active { transform: translateY(1px); }
.login-button:disabled { cursor: wait; filter: saturate(.75); }
.login-button svg { width: 18px; fill: currentColor; }

.spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.login-button.is-loading .spinner { display: block; }
.login-button.is-loading .button-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.card-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 17px;
    border-top: 1px solid rgba(133, 185, 220, .12);
    color: #708aa1;
    font-size: .67rem;
    letter-spacing: .04em;
}

.security-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #35c5ff;
    box-shadow: 0 0 10px rgba(53, 197, 255, .8);
}

.copyright {
    position: absolute;
    bottom: 22px;
    left: 50%;
    width: max-content;
    max-width: calc(100% - 30px);
    margin: 0;
    transform: translateX(-50%);
    color: rgba(175, 198, 216, .58);
    font-size: .68rem;
    letter-spacing: .06em;
    text-shadow: 0 1px 8px #000;
}

@media (max-width: 560px) {
    body { background-attachment: scroll; background-position: 46% center; }
    .page-shell { padding: 20px 14px 58px; }
    .login-card { padding: 23px 20px 19px; border-radius: 22px; }
    .brand-logo { width: min(100%, 294px); max-height: 204px; }
    .brand-tagline { font-size: .59rem; letter-spacing: .23em; }
    .divider { margin: 16px 0; }
    .intro { font-size: .82rem; }
}

@media (max-height: 760px) and (min-width: 561px) {
    .page-shell { padding-top: 18px; padding-bottom: 50px; }
    .login-card { padding-top: 20px; }
    .brand-logo { max-height: 176px; width: 285px; }
    .divider { margin: 13px 0; }
    .intro { margin-bottom: 14px; }
    .field-group { margin-bottom: 11px; }
    input { height: 48px; }
    .login-button { height: 49px; }
    .card-footer { margin-top: 15px; padding-top: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
