@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Rajdhani:wght@600;700&display=swap');

:root {
    --login-bg: #06070a;
    --login-surface: #0b0d12;
    --login-border: rgba(255, 255, 255, 0.1);
    --login-border-strong: rgba(255, 255, 255, 0.18);
    --login-text: #f5f7fb;
    --login-muted: #929baa;
    --login-red: #e12636;
    --login-success: #48d597;
    --login-danger: #ff6b78;
    --login-container: 1360px;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--login-bg); }
body { min-height: 100vh; margin: 0; color: var(--login-text); background: var(--login-bg); font-family: 'Plus Jakarta Sans', sans-serif; }
button, input { font: inherit; }
a { color: inherit; }

.skip-link {
    position: fixed; top: 0.75rem; left: 0.75rem; z-index: 100;
    padding: 0.75rem 1rem; color: #08090c; background: #fff; border-radius: 0.375rem;
    font-size: 0.8rem; font-weight: 800; text-decoration: none;
    transform: translateY(-160%); transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

.login-page { position: relative; min-height: 100vh; isolation: isolate; overflow: hidden; }
.login-backdrop, .login-backdrop::before, .login-backdrop::after { position: absolute; inset: 0; pointer-events: none; }
.login-backdrop {
    z-index: -3;
    background: linear-gradient(90deg, rgba(4,5,8,.72) 0%, rgba(4,5,8,.38) 46%, rgba(4,5,8,.92) 76%),
        linear-gradient(180deg, rgba(5,6,9,.22), #06070a 96%),
        url('../../assets/img/home-redesign/hero-city-background.webp') center / cover no-repeat;
    transform: scale(1.025);
}
.login-backdrop::before {
    content: ''; z-index: -2;
    background: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 72px 72px; mask-image: linear-gradient(90deg, #000, transparent 78%);
}
.login-backdrop::after {
    content: ''; z-index: -1;
    background: radial-gradient(circle at 22% 48%, rgba(201,28,43,.17), transparent 30%),
        linear-gradient(90deg, transparent 0 52%, rgba(6,7,10,.72) 66%, #06070a 100%);
}

.login-topbar {
    position: absolute; top: 0; left: 50%; z-index: 10;
    width: min(calc(100% - 3rem), var(--login-container)); min-height: 88px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.08); transform: translateX(-50%);
}
.login-brand, .login-return { display: inline-flex; align-items: center; text-decoration: none; }
.login-brand { gap: 0.75rem; }
.login-brand img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(225,38,54,.38)); }
.login-brand-copy { display: grid; line-height: 1; }
.login-brand-name { font-family: 'Rajdhani', sans-serif; font-size: 1.15rem; font-weight: 700; letter-spacing: .12em; }
.login-brand-name span { color: var(--login-red); }
.login-brand-copy small { margin-top: .3rem; color: var(--login-muted); font-family: 'JetBrains Mono', monospace; font-size: .58rem; font-weight: 700; letter-spacing: .32em; }
.login-return { min-height: 44px; gap: .65rem; padding: .65rem .9rem; color: #c2c8d2; font-size: .76rem; font-weight: 700; letter-spacing: .04em; transition: color .2s ease, transform .2s ease; }
.login-return:hover { color: #fff; transform: translateX(-3px); }

.login-layout {
    width: min(calc(100% - 3rem), var(--login-container)); min-height: 100vh; margin: 0 auto;
    padding: 7.5rem 0 3rem; display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 470px); align-items: center;
    gap: clamp(3rem, 8vw, 8rem);
}
.login-scene { position: relative; align-self: stretch; min-height: 620px; display: flex; align-items: flex-end; }
.scene-copy { position: absolute; top: 10%; left: 0; z-index: 3; max-width: 600px; }
.scene-eyebrow, .auth-eyebrow {
    display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem;
    color: #b4bdca; font-family: 'JetBrains Mono', monospace; font-size: .68rem;
    font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.scene-eyebrow::before, .auth-eyebrow::before { content: ''; width: 24px; height: 2px; background: var(--login-red); }
.scene-copy h2 { max-width: 700px; margin: 0; font-family: 'Rajdhani', sans-serif; font-size: clamp(3.2rem, 6vw, 6.6rem); font-weight: 700; line-height: .82; letter-spacing: -.045em; text-transform: uppercase; }
.scene-copy h2 span { color: var(--login-red); }
.scene-copy > p:last-child { max-width: 440px; margin: 1.5rem 0 0; color: #a7afbc; font-size: .95rem; line-height: 1.75; }

.character-stage {
    position: absolute; right: 3%; bottom: -3rem; z-index: 2;
    width: min(43vw, 465px); height: 70%; display: flex; align-items: flex-end; justify-content: center;
    transform-origin: 50% 100%; transition: transform .18s ease-out;
}
.character-stage::before {
    content: ''; position: absolute; bottom: 3.5rem; left: 50%; width: 74%; aspect-ratio: 1;
    border: 1px solid rgba(225,38,54,.28); border-radius: 50%; box-shadow: 0 0 80px rgba(225,38,54,.12);
    transform: translateX(-50%);
}
.character-image { position: relative; z-index: 2; height: 100%; min-height: 400px; display: flex; align-items: flex-end; justify-content: center; filter: drop-shadow(0 24px 35px rgba(0,0,0,.72)); transition: opacity .2s ease, filter .2s ease; }
.character-image.loading { opacity: .45; filter: grayscale(1) drop-shadow(0 24px 35px rgba(0,0,0,.72)); }
.character-image img { display: block; width: auto; max-width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.character-ground { position: absolute; bottom: 2.6rem; left: 50%; z-index: 1; width: 85%; height: 34px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; background: radial-gradient(ellipse, rgba(225,38,54,.3), rgba(0,0,0,.72) 64%, transparent 72%); transform: translateX(-50%); }
.player-identity { position: absolute; right: 0; bottom: 9%; z-index: 4; min-width: 185px; padding: .8rem 1rem; border-left: 2px solid var(--login-red); background: rgba(8,10,14,.84); backdrop-filter: blur(12px); opacity: 0; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease; }
.player-identity.visible { opacity: 1; transform: translateY(0); }
.player-identity small, .player-identity strong { display: block; }
.player-identity small { margin-bottom: .3rem; color: var(--login-muted); font-family: 'JetBrains Mono', monospace; font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; }
.player-identity strong { overflow: hidden; font-family: 'Rajdhani', sans-serif; font-size: 1.1rem; text-overflow: ellipsis; white-space: nowrap; }
.scene-index { position: absolute; bottom: 0; left: 0; z-index: 3; display: flex; align-items: center; gap: .75rem; color: #727b89; font-family: 'JetBrains Mono', monospace; font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.scene-index span { color: var(--login-red); }

.login-panel { position: relative; z-index: 5; padding: clamp(2rem, 4vw, 3.5rem); background: rgba(10,12,17,.9); border: 1px solid var(--login-border); box-shadow: 0 32px 90px rgba(0,0,0,.42); backdrop-filter: blur(24px); }
.login-panel::before, .login-panel::after { content: ''; position: absolute; pointer-events: none; background: var(--login-red); }
.login-panel::before { top: -1px; left: -1px; width: 68px; height: 2px; }
.login-panel::after { top: -1px; left: -1px; width: 2px; height: 68px; }
.auth-header { margin-bottom: 2rem; }
.auth-eyebrow { margin-bottom: .8rem; color: var(--login-red); }
.auth-header h1 { margin: 0; font-family: 'Rajdhani', sans-serif; font-size: clamp(2.5rem, 4vw, 3.5rem); font-weight: 700; line-height: .95; letter-spacing: -.035em; text-transform: uppercase; }
.auth-header > p:last-child { margin: 1rem 0 0; color: var(--login-muted); font-size: .9rem; line-height: 1.65; }
.login-alert { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1.5rem; padding: .85rem 1rem; color: #ffd4d8; background: rgba(225,38,54,.09); border: 1px solid rgba(255,107,120,.28); border-left: 2px solid var(--login-danger); font-size: .8rem; line-height: 1.55; }
.login-alert[hidden] { display: none; }
.login-alert i { margin-top: .2rem; color: var(--login-danger); }

.login-form { display: grid; gap: 1.25rem; }
.form-field { display: grid; gap: .55rem; }
.form-field label { color: #c9ced7; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.field-control { position: relative; }
.field-control > i { position: absolute; top: 50%; left: 1rem; z-index: 2; color: #687181; transform: translateY(-50%); transition: color .2s ease; }
.field-control input { width: 100%; min-height: 54px; padding: .85rem 3rem; color: var(--login-text); background: rgba(3,4,7,.68); border: 1px solid var(--login-border); border-radius: .375rem; outline: none; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.field-control input::placeholder { color: #596271; }
.field-control input:hover { border-color: var(--login-border-strong); }
.field-control input:focus { background: rgba(3,4,7,.9); border-color: rgba(225,38,54,.72); box-shadow: 0 0 0 3px rgba(225,38,54,.11); }
.field-control:focus-within > i { color: var(--login-red); }
.password-toggle { position: absolute; top: 50%; right: .45rem; min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; color: #8992a0; background: transparent; border: 0; border-radius: .25rem; cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover { color: #fff; }
.form-support { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: -.15rem; }
.security-state { display: inline-flex; align-items: center; gap: .45rem; color: #7f8998; font-family: 'JetBrains Mono', monospace; font-size: .59rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.security-state i { color: var(--login-success); }
.support-link { color: #aeb6c2; font-size: .72rem; font-weight: 700; text-decoration-color: rgba(174,182,194,.35); text-underline-offset: .25rem; }
.support-link:hover { color: #fff; }

.submit-button { position: relative; width: 100%; min-height: 56px; display: inline-flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .35rem; padding: .8rem 1.1rem .8rem 1.25rem; color: #fff; background: var(--login-red); border: 1px solid #f04a58; border-radius: .375rem; box-shadow: 0 12px 30px rgba(163,18,31,.24); cursor: pointer; font-family: 'Rajdhani', sans-serif; font-size: .95rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.submit-button:hover:not(:disabled) { background: #f02e40; box-shadow: 0 16px 36px rgba(163,18,31,.35); transform: translateY(-2px); }
.submit-button:disabled { color: #8d929b; background: #272a31; border-color: #343840; box-shadow: none; cursor: not-allowed; }
.submit-button .button-icon { width: 34px; height: 34px; display: grid; place-items: center; background: rgba(0,0,0,.16); border-radius: 50%; }
.submit-button.is-loading .button-icon i { animation: loginSpin .8s linear infinite; }
.auth-legal { margin: 1.5rem 0 0; color: #697281; font-size: .65rem; line-height: 1.6; text-align: center; }
.auth-legal a { color: #9da6b3; text-underline-offset: .2rem; }
.login-footer-mark { position: absolute; right: 1.5rem; bottom: 1.25rem; z-index: 5; margin: 0; color: #555e6c; font-family: 'JetBrains Mono', monospace; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }

.login-return:focus-visible, .login-brand:focus-visible, .password-toggle:focus-visible,
.support-link:focus-visible, .submit-button:focus-visible, .auth-legal a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@keyframes loginSpin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
    .login-backdrop { background-position: 35% center; }
    .login-layout { grid-template-columns: minmax(0, .9fr) minmax(370px, 450px); gap: 2rem; }
    .scene-copy h2 { font-size: clamp(3rem, 7vw, 5rem); }
    .character-stage { right: -5%; opacity: .72; }
}
@media (min-width: 821px) and (max-height: 800px) {
    .login-layout { padding-top: 6rem; padding-bottom: 1.5rem; }
    .login-scene { min-height: 560px; }
    .scene-copy { top: 8%; }
    .scene-copy > p:last-child { margin-top: 1rem; }
    .login-panel { padding: 2rem 2.5rem; }
    .auth-header { margin-bottom: 1.35rem; }
    .auth-header > p:last-child { margin-top: .7rem; }
    .login-form { gap: .9rem; }
    .field-control input { min-height: 50px; }
    .submit-button { min-height: 52px; }
    .auth-legal { margin-top: 1rem; }
}
@media (max-width: 820px) {
    .login-page { overflow: auto; }
    .login-backdrop { position: fixed; background-position: 34% center; }
    .login-backdrop::after { background: rgba(6,7,10,.84); }
    .login-topbar { width: min(calc(100% - 2rem), 620px); min-height: 72px; }
    .login-layout { width: min(calc(100% - 2rem), 620px); min-height: 100svh; padding: 6rem 0 4.5rem; display: block; }
    .login-scene { display: none; }
    .login-panel { margin-top: clamp(1rem, 8vh, 5rem); }
}
@media (max-width: 520px) {
    .login-topbar { width: calc(100% - 1.5rem); }
    .login-brand-copy small, .login-return span { display: none; }
    .login-layout { width: calc(100% - 1.5rem); padding-top: 5.5rem; }
    .login-panel { padding: 1.75rem 1.25rem; }
    .auth-header { margin-bottom: 1.5rem; }
    .form-support { align-items: flex-start; flex-direction: column; gap: .75rem; }
    .login-footer-mark { position: relative; right: auto; bottom: auto; padding: 0 1rem 1.25rem; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
