:root {
    color-scheme: dark;
    --bg: #050c0f;
    --panel: #071216;
    --panel-soft: #0a191d;
    --line: #193139;
    --line-strong: #28515a;
    --text: #edf7f7;
    --muted: #759097;
    --muted-light: #a9bcc0;
    --accent: #18b6ad;
    --accent-bright: #38d5ca;
    --accent-deep: #0a7e79;
    --discord: #5865f2;
    --danger: #ff6c72;
    --mono: "Roboto Mono", "Cascadia Mono", "Consolas", monospace;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(520px, 46%) 1fr;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    background: var(--bg);
}

.login-pane {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    padding: 34px clamp(34px, 4vw, 76px) 27px;
    background:
        linear-gradient(rgba(24, 182, 173, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(24, 182, 173, .025) 1px, transparent 1px),
        radial-gradient(circle at 20% 5%, rgba(24, 182, 173, .07), transparent 32%),
        var(--panel);
    background-size: 42px 42px, 42px 42px, auto, auto;
    border-right: 1px solid rgba(56, 213, 202, .18);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: max-content;
}

.brand-logo {
    display: block;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 0 13px rgba(255, 106, 97, .2));
}

.brand-copy {
    display: grid;
    gap: 4px;
}

.brand-copy strong {
    font-size: 17px;
    letter-spacing: .075em;
}

.brand-copy small {
    color: var(--muted);
    font: 600 9px/1.2 var(--mono);
    letter-spacing: .105em;
}

.login-card {
    width: min(100%, 420px);
    margin: auto;
    padding: 58px 0 64px;
}

.access-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 17px;
    color: var(--accent-bright);
    font: 700 10px/1.2 var(--mono);
    letter-spacing: .13em;
}

.access-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-bright);
    box-shadow: 0 0 0 4px rgba(56, 213, 202, .08), 0 0 12px var(--accent);
}

.login-card h1 {
    margin: 0;
    font-size: clamp(35px, 4vw, 46px);
    line-height: 1;
    letter-spacing: -.035em;
}

.login-intro {
    max-width: 355px;
    margin: 16px 0 35px;
    color: var(--muted-light);
    font-size: 14px;
    line-height: 1.7;
}

.system-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -16px 0 20px;
    padding: 11px 12px;
    border: 1px solid rgba(255, 183, 77, .28);
    background: rgba(255, 183, 77, .05);
    color: #e3c087;
    font-size: 12px;
    line-height: 1.4;
}

.system-notice span {
    color: #ffb74d;
    font: 800 9px/1 var(--mono);
    letter-spacing: .1em;
}

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

.field-group {
    display: grid;
    gap: 9px;
}

.field-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.field-group label,
.field-heading a {
    font-size: 12px;
    font-weight: 700;
}

.field-group label {
    color: #d8e6e8;
}

.field-heading a {
    color: var(--muted);
    text-decoration-color: rgba(117, 144, 151, .4);
    text-underline-offset: 3px;
    transition: color .18s ease;
}

.field-heading a:hover {
    color: var(--accent-bright);
}

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

.input-wrap > svg {
    position: absolute;
    left: 15px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition: stroke .18s ease;
}

.input-wrap input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 3px;
    outline: none;
    background: rgba(4, 13, 16, .74);
    color: var(--text);
    padding: 0 48px;
    font-size: 13px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.input-wrap input::placeholder {
    color: #527078;
}

.input-wrap:focus-within > svg {
    stroke: var(--accent-bright);
}

.input-wrap input:focus {
    border-color: var(--accent);
    background: rgba(5, 20, 23, .95);
    box-shadow: 0 0 0 3px rgba(24, 182, 173, .09), inset 2px 0 0 var(--accent);
}

.password-toggle {
    position: absolute;
    right: 7px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--accent-bright);
    background: rgba(24, 182, 173, .07);
    outline: none;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle .eye-closed {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
    display: block;
}

.primary-button,
.discord-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    justify-content: space-between;
    margin-top: 4px;
    padding: 0 17px 0 21px;
    border: 1px solid var(--accent-bright);
    background: linear-gradient(90deg, var(--accent-deep), var(--accent));
    color: #eaffff;
    font: 800 12px/1 var(--mono);
    letter-spacing: .1em;
    box-shadow: 0 10px 28px rgba(0, 106, 102, .2);
    transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}

.primary-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.primary-button:hover {
    filter: brightness(1.12);
    box-shadow: 0 12px 34px rgba(0, 159, 151, .28);
    transform: translateY(-1px);
}

.primary-button:active {
    transform: translateY(0);
}

.divider {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 26px 0 18px;
    color: #4f6c73;
    font: 700 9px/1 var(--mono);
    letter-spacing: .13em;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.discord-button {
    gap: 11px;
    border: 1px solid #273d45;
    background: #0a181c;
    color: #dbe9eb;
    font-size: 13px;
    font-weight: 700;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.discord-button svg {
    width: 21px;
    height: 21px;
    fill: #7b86ff;
}

.discord-button:hover {
    border-color: rgba(88, 101, 242, .72);
    background: rgba(88, 101, 242, .11);
    color: #fff;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #506c73;
    font: 700 9px/1 var(--mono);
    letter-spacing: .1em;
}

.login-footer span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.login-footer i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.visual-pane {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    background-image:
        linear-gradient(90deg, rgba(4, 13, 16, .75) 0%, rgba(4, 13, 16, .34) 42%, rgba(3, 9, 11, .58) 100%),
        linear-gradient(0deg, rgba(3, 10, 12, .8) 0%, transparent 44%),
        url("../images/login-background.png");
    background-position: center;
    background-size: cover;
}

.visual-pane::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 30, 32, .35), transparent 55%);
    box-shadow: inset 0 0 130px rgba(0, 0, 0, .54);
}

.visual-grid {
    position: absolute;
    inset: 0;
    opacity: .18;
    background-image:
        linear-gradient(rgba(56, 213, 202, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 213, 202, .16) 1px, transparent 1px);
    background-size: 68px 68px;
    mask-image: linear-gradient(90deg, transparent, #000 45%, #000);
}

.visual-scanline {
    position: absolute;
    inset: 0;
    opacity: .09;
    background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(169, 235, 231, .22) 4px);
    pointer-events: none;
}

.visual-topline,
.coordinates,
.visual-copy {
    position: absolute;
    z-index: 1;
}

.visual-topline {
    top: 37px;
    right: 42px;
    left: 42px;
    display: flex;
    justify-content: space-between;
    color: rgba(220, 241, 241, .68);
    font: 700 9px/1 var(--mono);
    letter-spacing: .14em;
}

.visual-copy {
    right: clamp(42px, 5vw, 86px);
    bottom: 12vh;
    left: clamp(42px, 5vw, 86px);
    max-width: 660px;
}

.visual-code {
    display: inline-block;
    margin-bottom: 16px;
    padding: 7px 10px;
    border-left: 2px solid var(--accent-bright);
    background: rgba(3, 14, 16, .65);
    color: var(--accent-bright);
    font: 700 10px/1 var(--mono);
    letter-spacing: .15em;
}

.visual-copy h2 {
    margin: 0;
    color: #f2fbfb;
    font-size: clamp(38px, 5.1vw, 74px);
    line-height: .98;
    letter-spacing: -.045em;
    text-shadow: 0 5px 28px rgba(0, 0, 0, .65);
}

.visual-copy h2 em {
    color: var(--accent-bright);
    font-style: normal;
}

.visual-copy > p {
    max-width: 520px;
    margin: 20px 0 30px;
    color: rgba(220, 237, 238, .78);
    font-size: 14px;
    line-height: 1.7;
    text-shadow: 0 2px 15px #000;
}

.visual-meta {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.visual-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 115px;
    padding: 9px 11px;
    border: 1px solid rgba(135, 188, 190, .25);
    background: rgba(2, 12, 14, .62);
    color: #a9c1c4;
    font: 700 9px/1 var(--mono);
    letter-spacing: .08em;
}

.visual-meta b {
    color: var(--accent-bright);
    font-weight: 800;
}

.coordinates {
    right: 42px;
    bottom: 31px;
    color: rgba(211, 234, 234, .5);
    font: 600 8px/1 var(--mono);
    letter-spacing: .14em;
}

.toast {
    position: fixed;
    z-index: 20;
    right: 22px;
    bottom: 22px;
    max-width: min(390px, calc(100vw - 44px));
    padding: 13px 16px;
    border: 1px solid var(--line-strong);
    background: #09171b;
    color: var(--muted-light);
    font-size: 12px;
    line-height: 1.45;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1050px) {
    .login-shell {
        grid-template-columns: minmax(470px, 55%) 1fr;
    }

    .visual-copy h2 {
        font-size: clamp(36px, 5vw, 58px);
    }

    .visual-meta span:nth-child(3) {
        display: none;
    }
}

@media (max-width: 760px) {
    .login-shell {
        display: block;
        min-height: 100vh;
        background:
            linear-gradient(rgba(4, 13, 16, .9), rgba(4, 13, 16, .96)),
            url("../images/login-background.png") center / cover fixed;
    }

    .login-pane {
        min-height: 100vh;
        padding: 24px clamp(20px, 7vw, 50px) 22px;
        border-right: 0;
        background: linear-gradient(180deg, rgba(5, 16, 19, .88), rgba(5, 14, 17, .97));
    }

    .brand-copy small {
        max-width: 250px;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
    }

    .login-card {
        padding: 55px 0;
    }

    .visual-pane {
        display: none;
    }
}

@media (max-height: 760px) and (min-width: 761px) {
    .login-pane {
        padding-top: 24px;
        padding-bottom: 20px;
    }

    .login-card {
        padding-top: 28px;
        padding-bottom: 30px;
    }

    .login-intro {
        margin-bottom: 23px;
    }

    .login-form {
        gap: 14px;
    }

    .divider {
        margin-top: 19px;
        margin-bottom: 14px;
    }
}

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