:root {
    color-scheme: dark;
    --bg: #070a10;
    --surface: #0d131d;
    --surface-2: #121b28;
    --text: #f7faff;
    --muted: #9ba9bb;
    --border: rgba(255, 255, 255, 0.09);
    --accent: #58e0c2;
    --accent-strong: #28c9a6;
    --danger: #ff7a87;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-width: 300px;
    min-height: 100%;
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(15px, 0.9vw, 19px);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    background:
        radial-gradient(circle at 14% 16%, rgba(40, 201, 166, 0.2), transparent 30rem),
        radial-gradient(circle at 88% 86%, rgba(35, 82, 114, 0.19), transparent 28rem),
        var(--bg);
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(23rem, 0.92fr);
    width: min(74rem, calc(100% - 4rem));
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    align-items: center;
    gap: clamp(3rem, 8vw, 8rem);
    padding: 3rem 0;
}

.welcome {
    display: flex;
    min-height: 36rem;
    flex-direction: column;
    justify-content: space-between;
}

.brand,
.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-mark {
    position: relative;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid rgba(88, 224, 194, 0.35);
    border-radius: 0.85rem;
    background: rgba(88, 224, 194, 0.1);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
    position: absolute;
    content: "";
    border-radius: 999px;
    background: var(--accent);
}

.brand-mark::before {
    width: 1.2rem;
    height: 0.24rem;
    transform: translateY(-0.4rem);
}

.brand-mark::after {
    width: 1.2rem;
    height: 0.24rem;
    transform: translateY(0.4rem);
}

.brand-mark span {
    width: 0.24rem;
    height: 1.2rem;
}

.brand-name {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.welcome-copy {
    max-width: 36rem;
}

.eyebrow {
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.welcome h1 {
    max-width: 11ch;
    font-size: clamp(2.8rem, 4.6vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.welcome-text {
    max-width: 34rem;
    margin-top: 1.5rem;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.features {
    display: grid;
    gap: 0.8rem;
    list-style: none;
}

.features li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: #c8d2df;
    font-size: 0.85rem;
}

.features span {
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.login-card {
    width: 100%;
    max-width: 29rem;
    justify-self: end;
    padding: clamp(2rem, 3.5vw, 3rem);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    background: rgba(13, 19, 29, 0.96);
    box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.28);
}

.mobile-brand {
    display: none;
    margin-bottom: 2.4rem;
}

.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.status span {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0.3rem rgba(88, 224, 194, 0.1);
}

.card-heading h2 {
    font-size: 2.1rem;
    letter-spacing: -0.04em;
}

.card-heading > p:last-child {
    margin-top: 0.65rem;
    color: var(--muted);
    line-height: 1.5;
}

.error-message {
    display: none;
    margin-top: 1.3rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 122, 135, 0.28);
    border-radius: 0.75rem;
    color: #ffb4bc;
    background: rgba(255, 122, 135, 0.08);
    font-size: 0.8rem;
    line-height: 1.4;
}

.error-message.visible {
    display: block;
}

form {
    display: grid;
    gap: 1.15rem;
    margin-top: 2rem;
}

.field {
    display: grid;
    gap: 0.55rem;
}

.field > span:first-child {
    color: #cbd5e2;
    font-size: 0.78rem;
    font-weight: 700;
}

.input-wrap {
    display: flex;
    height: 3.5rem;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--surface-2);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 224, 194, 0.11);
}

.input-wrap > svg {
    width: 1.15rem;
    margin-left: 1rem;
    fill: none;
    stroke: var(--muted);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

input {
    min-width: 0;
    height: 100%;
    flex: 1;
    padding: 0 0.9rem;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-size: 0.9rem;
}

input::placeholder {
    color: #687689;
}

.show-password {
    display: grid;
    width: 3.3rem;
    height: 100%;
    flex: none;
    place-items: center;
    cursor: pointer;
    color: var(--muted);
    background: transparent;
}

.show-password svg {
    width: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.show-password .eye-closed,
.show-password.visible .eye-open {
    display: none;
}

.show-password.visible .eye-closed {
    display: block;
}

.submit-button {
    display: flex;
    height: 3.6rem;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
    border-radius: 0.85rem;
    cursor: pointer;
    color: #04110e;
    background: var(--accent);
    font-size: 0.88rem;
    font-weight: 800;
    transition: background-color 120ms ease, transform 120ms ease;
}

.submit-button:hover {
    background: #77ead1;
}

.submit-button:active {
    transform: scale(0.99);
}

.submit-button > svg {
    width: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.button-loading {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(4, 17, 14, 0.3);
    border-top-color: #04110e;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.submit-button.loading .button-loading {
    display: block;
}

.submit-button.loading > svg {
    display: none;
}

.apk-download {
    display: flex;
    min-height: 3.25rem;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(128, 108, 255, 0.38);
    border-radius: 0.85rem;
    color: #e8e3ff;
    background: rgba(128, 108, 255, 0.1);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
    transition: border-color 120ms ease, background-color 120ms ease;
}

.apk-download:hover {
    border-color: rgba(128, 108, 255, 0.75);
    background: rgba(128, 108, 255, 0.18);
}

.apk-download svg {
    width: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.apk-download span {
    padding: 0.18rem 0.4rem;
    border-radius: 0.35rem;
    color: #bfb3ff;
    background: rgba(128, 108, 255, 0.16);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 1.35rem;
    color: #718095;
    font-size: 0.68rem;
    text-align: center;
}

.security-note svg {
    width: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

button:focus-visible,
input:focus-visible,
.apk-download:focus-visible {
    outline: 3px solid #f5c451;
    outline-offset: 2px;
}

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

@media (max-width: 820px) {
    .login-shell {
        display: flex;
        width: min(100% - 2rem, 31rem);
        justify-content: center;
        padding: 1rem 0;
    }

    .welcome {
        display: none;
    }

    .login-card {
        max-width: none;
        justify-self: auto;
    }

    .mobile-brand {
        display: flex;
    }
}

@media (max-width: 420px) {
    .login-shell {
        width: 100%;
        padding: 0;
    }

    .login-card {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 2rem 1.35rem;
        border: 0;
        border-radius: 0;
        background: rgba(9, 14, 22, 0.96);
    }
}

@media (min-width: 821px) and (max-height: 720px) {
    .login-shell {
        padding: 1.5rem 0;
    }

    .welcome {
        min-height: 31rem;
    }

    .login-card {
        padding: 2rem 2.4rem;
    }

    .welcome h1 {
        font-size: 3.3rem;
    }

    form {
        margin-top: 1.4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
