:root {
    --nexus-cyan: #25cbed;
    --nexus-cyan-bright: #55dcf5;
    --nexus-ink: #06111e;
    --nexus-text: #f5fbff;
    --nexus-muted: #95aabd;
}

.nexus-login, .nexus-login * { box-sizing: border-box; }

.nexus-login {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: 100svh;
    width: 100%;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 112px 32px 24px;
    color: var(--nexus-text);
    background: var(--nexus-ink) url("/images/backgrounds/nexus-background.png") center / cover no-repeat;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.nexus-login::before {
    position: absolute;
    z-index: -2;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, rgba(2,9,17,.94), rgba(4,16,29,.76) 48%, rgba(3,11,20,.89)), linear-gradient(180deg, transparent, rgba(3,10,18,.84));
}

.nexus-login__glow {
    position: absolute;
    z-index: -1;
    top: 8%;
    left: 50%;
    width: min(900px, 72vw);
    height: 540px;
    border-radius: 50%;
    background: rgba(23,187,225,.13);
    filter: blur(130px);
    transform: translateX(-50%);
    pointer-events: none;
}

.nexus-login__brand {
    position: absolute;
    top: 27px;
    left: clamp(28px, 5vw, 80px);
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nexus-login__brand img {
    width: 244px;
    height: 94px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 0 10px rgba(37,203,237,.4));
}

.nexus-login__card {
    display: grid;
    grid-template-columns: 48% 52%;
    width: min(1110px, 100%);
    min-height: 596px;
    overflow: hidden;
    border: 1px solid rgba(135,205,225,.2);
    border-radius: 24px;
    background: rgba(8,24,37,.88);
    box-shadow: 0 34px 90px rgba(0,0,0,.5), inset 0 1px rgba(255,255,255,.04);
    backdrop-filter: blur(25px);
}

.nexus-login__intro {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 64px 60px;
    border-right: 1px solid rgba(132,195,214,.16);
    background: radial-gradient(circle at 18% 24%, rgba(38,205,238,.16), transparent 37%), linear-gradient(145deg, rgba(12,44,61,.9), rgba(5,21,34,.96));
}

.nexus-login__intro::after {
    position: absolute;
    inset: 0;
    content: "";
    opacity: .25;
    background-image: linear-gradient(rgba(90,207,232,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(90,207,232,.08) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(135deg, black, transparent 75%);
    pointer-events: none;
}

.nexus-login__intro-content { position: relative; z-index: 2; max-width: 390px; }
.nexus-login__eyebrow { margin: 0; color: var(--nexus-cyan); font-size: 12px; font-weight: 700; letter-spacing: .24em; }
.nexus-login__intro h1 { margin: 18px 0 24px; color: #fff; font-size: clamp(44px,4vw,62px); font-weight: 300; line-height: 1.04; letter-spacing: -.045em; }
.nexus-login__description { max-width: 350px; margin: 0; color: #b5c7d4; font-size: 16px; line-height: 1.7; }
.nexus-login__features { display: flex; flex-wrap: wrap; gap: 11px 20px; margin-top: 40px; color: #d6e5ec; font-size: 12px; }
.nexus-login__features span { display: flex; align-items: center; gap: 7px; }
.nexus-login__features i { width: 5px; height: 5px; border-radius: 50%; background: var(--nexus-cyan); box-shadow: 0 0 8px var(--nexus-cyan); }
.nexus-login__watermark { position: absolute; z-index: 1; right: -118px; bottom: -176px; width: 480px; height: 560px; object-fit: contain; opacity: .07; transform: rotate(-8deg); user-select: none; pointer-events: none; }

.nexus-login__form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px clamp(58px,6vw,72px);
    background: linear-gradient(155deg, rgba(13,31,45,.94), rgba(7,20,32,.98));
}

.nexus-login__form-header { margin-bottom: 34px; }
.nexus-login__form-header h2 { margin: 9px 0 8px; color: #f7fcff; font-size: clamp(28px,3vw,36px); font-weight: 500; letter-spacing: -.025em; }
.nexus-login__form-header p { margin: 0; color: var(--nexus-muted); font-size: 14px; }
.nexus-login__field { margin-bottom: 21px; }
.nexus-login__field label, .nexus-login__label-row { color: #dbe8ee; font-size: 13px; font-weight: 600; }
.nexus-login__field > label { display: block; margin-bottom: 9px; }
.nexus-login__label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.nexus-login__label-row a { color: var(--nexus-cyan); font-size: 12px; font-weight: 500; text-decoration: none; }
.nexus-login__label-row a:hover, .nexus-login__register a:hover, .nexus-login__footer a:hover { color: var(--nexus-cyan-bright); text-decoration: underline; }

.nexus-login__control {
    display: flex;
    align-items: center;
    height: 54px;
    border: 1px solid rgba(145,180,198,.22);
    border-radius: 10px;
    background: rgba(2,12,21,.62);
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.nexus-login__control:focus-within { border-color: rgba(37,203,237,.8); background: rgba(4,17,28,.84); box-shadow: 0 0 0 3px rgba(37,203,237,.1), 0 0 22px rgba(37,203,237,.08); }
.nexus-login__control svg { width: 20px; height: 20px; margin: 0 13px 0 17px; fill: none; stroke: #7192a6; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; transition: stroke .2s; }
.nexus-login__control:focus-within svg { stroke: var(--nexus-cyan); }
.nexus-login__control input { min-width: 0; height: 100%; flex: 1; padding: 0 17px 0 0; border: 0; outline: 0; color: #eef9fd; background: transparent; font: inherit; font-size: 14px; }
.nexus-login__control input::placeholder { color: #60798b; }

.nexus-login__remember { display: flex; width: fit-content; align-items: center; gap: 9px; margin: 0 0 25px; color: #96aebe; font-size: 12px; cursor: pointer; user-select: none; }
.nexus-login__remember input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.nexus-login__remember span { position: relative; width: 17px; height: 17px; border: 1px solid #527184; border-radius: 4px; background: #071522; }
.nexus-login__remember input:checked + span { border-color: var(--nexus-cyan); background: var(--nexus-cyan); }
.nexus-login__remember input:checked + span::after { position: absolute; top: 2px; left: 5px; width: 5px; height: 9px; border: solid #05202c; border-width: 0 2px 2px 0; content: ""; transform: rotate(45deg); }
.nexus-login__remember input:focus-visible + span { outline: 2px solid var(--nexus-cyan); outline-offset: 2px; }

.nexus-login__error { display: flex; align-items: center; gap: 10px; margin: -7px 0 18px; padding: 11px 13px; border: 1px solid rgba(255,107,115,.32); border-radius: 8px; color: #ffc0c4; background: rgba(122,25,35,.2); font-size: 12px; }
.nexus-login__error svg { width: 18px; height: 18px; flex: none; fill: none; stroke: #ff7680; stroke-linecap: round; stroke-width: 1.8; }

.nexus-login__submit { display: flex; width: 100%; height: 54px; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 10px; color: #03202b; background: linear-gradient(105deg,#20badd,#46d8f2); box-shadow: 0 12px 26px rgba(22,182,218,.18); font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: transform .2s, box-shadow .2s, filter .2s; }
.nexus-login__submit:hover:not(:disabled) { box-shadow: 0 15px 34px rgba(28,199,237,.3); filter: brightness(1.06); transform: translateY(-1px); }
.nexus-login__submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.nexus-login__submit:disabled { cursor: wait; filter: saturate(.55); opacity: .72; }
.nexus-login__submit svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.nexus-login__spinner { width: 18px; height: 18px; border: 2px solid rgba(3,32,43,.28); border-top-color: #03202b; border-radius: 50%; animation: nexus-login-spin .7s linear infinite; }
@keyframes nexus-login-spin { to { transform: rotate(360deg); } }

.nexus-login__separator { display: flex; align-items: center; gap: 14px; margin: 24px 0 20px; color: #6f8797; font-size: 10px; letter-spacing: .12em; }
.nexus-login__separator::before, .nexus-login__separator::after { height: 1px; flex: 1; content: ""; background: rgba(132,172,191,.15); }
.nexus-login__register { margin: 0; color: #8ea5b5; font-size: 13px; text-align: center; }
.nexus-login__register a { margin-left: 4px; color: var(--nexus-cyan); font-weight: 600; text-decoration: none; }

.nexus-login__footer { display: flex; width: min(1110px,100%); align-items: center; justify-content: space-between; margin-top: 24px; color: #668093; font-size: 11px; }
.nexus-login__footer nav { display: flex; gap: 25px; }
.nexus-login__footer a { color: #8299a8; text-decoration: none; }

@media (max-width: 900px) {
    .nexus-login { align-items: start; padding: 96px 22px 24px; }
    .nexus-login__card { grid-template-columns: 1fr; max-width: 590px; }
    .nexus-login__intro { min-height: 270px; padding: 42px 48px; border-right: 0; border-bottom: 1px solid rgba(132,195,214,.16); }
    .nexus-login__intro h1 { margin: 12px 0 17px; font-size: 43px; }
    .nexus-login__features { margin-top: 24px; }
    .nexus-login__watermark { right: -75px; bottom: -145px; width: 390px; height: 460px; }
    .nexus-login__form-panel { padding: 48px; }
}

@media (max-width: 767px) {
    .nexus-login__card { max-width: 540px; }
    .nexus-login__intro { display: none; }
    .nexus-login__form-panel { min-height: 0; padding: 44px clamp(25px,7vw,42px); }
}

@media (max-width: 560px) {
    .nexus-login { display: grid; padding: 82px 15px 18px; }
    .nexus-login__brand { top: 20px; left: 20px; font-size: 16px; }
    .nexus-login__brand img { width: 195px; height: 75px; }
    .nexus-login__card { border-radius: 17px; }
    .nexus-login__form-panel { padding: 38px 25px 42px; }
    .nexus-login__form-header { margin-bottom: 29px; }
    .nexus-login__form-header h2 { font-size: 28px; }
    .nexus-login__footer { flex-direction: column; gap: 8px; }
}

@media (max-height: 760px) and (min-width: 901px) {
    .nexus-login { padding-top: 82px; padding-bottom: 64px; }
    .nexus-login__card { min-height: 560px; }
    .nexus-login__intro, .nexus-login__form-panel { padding-top: 42px; padding-bottom: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    .nexus-login__submit { transition: none; }
    .nexus-login__spinner { animation-duration: 1.5s; }
}
