:root {
    color-scheme: light;
    --page-gutter: clamp(16px, 4.5vw, 56px);
    --shell-max-width: 1060px;
    --shell-max-height: 646px;
    --page-bg: #f4f6fb;
    --card: #ffffff;
    --field-bg: #f7f9fc;
    --field-border: #d8deeb;
    --text: #172033;
    --muted: #6f7b8c;
    --soft: #9aa6b6;
    --primary: #0ea5a3;
    --primary-dark: #0f766e;
    --primary-soft: #ecfeff;
    --accent: #2563eb;
    --shadow: 0 32px 90px rgba(28, 39, 64, 0.16);
    --input-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

* { box-sizing: border-box; }

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

body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: var(--page-gutter);
    overflow-x: hidden;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 18% 17%, rgba(14, 165, 163, 0.16), transparent 31%),
        radial-gradient(circle at 84% 15%, rgba(37, 99, 235, 0.12), transparent 28%),
        linear-gradient(180deg, #fbfdfd 0%, var(--page-bg) 100%);
    color: var(--text);
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

.login-shell {
    width: min(var(--shell-max-width), calc(100vw - (var(--page-gutter) * 2)));
    height: clamp(560px, calc(100dvh - (var(--page-gutter) * 2)), var(--shell-max-height));
    margin: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    overflow: hidden;
    border-radius: 28px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.login-shell--auth-flow,
.password-shell {
    height: auto;
    min-height: clamp(520px, calc(100dvh - (var(--page-gutter) * 2)), var(--shell-max-height));
}

.password-shell {
    width: min(var(--shell-max-width), calc(100vw - (var(--page-gutter) * 2)));
    margin: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    overflow: hidden;
    border-radius: 28px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.password-form {
    width: 100%;
    display: grid;
    gap: 23px;
}

.password-shell .input-wrap .text-input {
    padding-right: 46px;
}

.visual-panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(40px, 6vh, 64px) clamp(28px, 4.5vw, 58px);
    text-align: center;
    background:
        radial-gradient(circle at 52% 33%, rgba(14, 165, 163, 0.16), transparent 26%),
        linear-gradient(135deg, #ecfeff 0%, #fbfcff 66%, #eef2f7 100%);
}

.hero-icon-wrap {
    position: relative;
    width: min(255px, 58vw);
    height: min(255px, 58vw);
    display: grid;
    place-items: center;
    margin-bottom: 31px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--primary);
    border: 5px solid #ffffff;
    box-shadow: 0 22px 42px rgba(28, 39, 64, 0.16);
}

.hero-logo {
    width: min(132px, 30vw);
    height: min(132px, 30vw);
    display: block;
    border-radius: 28px;
    filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.03));
}

.orbit-badge {
    position: absolute;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 10px 25px rgba(28, 39, 64, 0.14);
}

.orbit-badge svg {
    width: 25px;
    height: 25px;
}

.orbit-badge--top {
    top: 20px;
    right: -5px;
    color: var(--accent);
}

.orbit-badge--bottom {
    left: -4px;
    bottom: 27px;
}

.visual-panel h2 {
    margin: 0 0 14px;
    color: #142033;
    font-size: clamp(24px, 4vw, 31px);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: 0;
}

.visual-panel p {
    max-width: 365px;
    margin: 0 auto;
    color: #5f6d7f;
    font-size: 14px;
    line-height: 1.75;
    font-weight: 500;
}

.form-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(40px, 6vh, 64px) clamp(28px, 4.5vw, 58px);
    background: #ffffff;
}

.form-card {
    width: min(416px, 100%);
    display: grid;
    justify-items: center;
}

.brand-tile {
    width: 49px;
    height: 49px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 15px;
    background: #ffffff;
    border: 1px solid rgba(14, 165, 163, 0.14);
    box-shadow: 8px 8px 0 rgba(14, 165, 163, 0.12);
}

.brand-tile img {
    width: 30px;
    height: 30px;
    display: block;
}

.form-card h1 {
    margin: 0;
    color: #142033;
    font-size: clamp(24px, 4vw, 31px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 0;
    text-align: center;
}

.form-subtitle {
    margin: 11px 0 33px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.login-form {
    width: 100%;
    display: grid;
    gap: 23px;
}

.login-alert {
    display: none;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(210, 56, 56, 0.18);
    background: rgba(210, 56, 56, 0.08);
    color: #9b2424;
    font-size: 13px;
    line-height: 1.5;
}

.login-alert--success {
    border-color: rgba(14, 165, 163, 0.22);
    background: rgba(14, 165, 163, 0.1);
    color: #0f766e;
}

.login-alert.is-visible { display: block; }
.field-group { display: grid; gap: 9px; }
.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.field-label {
    color: #354254;
    font-size: 14px;
    font-weight: 800;
}

.forgot-link,
.back-link {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.forgot-link:hover,
.back-link:hover { color: var(--primary-dark); }

.input-wrap { position: relative; }

.input-icon,
.password-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--soft);
}

.input-icon {
    left: 14px;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.input-icon svg,
.password-toggle svg {
    width: 21px;
    height: 21px;
}

.text-input {
    width: 100%;
    height: 50px;
    border: 1px solid var(--field-border);
    border-radius: 14px;
    background: var(--field-bg);
    box-shadow: var(--input-shadow);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    padding: 0 16px 0 40px;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.text-input::placeholder {
    color: #97a3b2;
    font-weight: 600;
}

.text-input:focus {
    border-color: rgba(14, 165, 163, 0.48);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(14, 165, 163, 0.12);
}

.input-wrap--password .text-input { padding-right: 46px; }

.password-toggle {
    right: 12px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.password-toggle:hover { color: var(--primary); }

.submit-btn {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 13px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(14, 165, 163, 0.22);
    transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(14, 165, 163, 0.26);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.form-footer {
    width: 100%;
    margin-top: 8px;
    text-align: center;
}

.form-hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    font-weight: 500;
    text-align: center;
}

.copyright {
    margin: 31px 0 0;
    color: #9aa4b2;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

@media (max-width: 900px) {
    body { padding: 18px; }

    .login-shell,
    .login-shell--auth-flow,
    .password-shell {
        grid-template-columns: 1fr;
        width: min(520px, 100%);
        height: auto;
        min-height: 0;
        max-width: 520px;
    }

    .visual-panel { padding: 36px 28px 28px; }
    .form-panel { padding: 36px 28px 40px; }

    .hero-icon-wrap {
        width: 190px;
        height: 190px;
        margin-bottom: 22px;
    }

    .hero-logo {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 520px) {
    body { padding: 12px; }

    .login-shell,
    .login-shell--auth-flow,
    .password-shell { border-radius: 22px; }

    .visual-panel { padding: 28px 18px 22px; }
    .form-panel { padding: 28px 18px 32px; }

    .hero-icon-wrap {
        width: 150px;
        height: 150px;
        margin-bottom: 18px;
        border-width: 4px;
    }

    .hero-logo {
        width: 78px;
        height: 78px;
        border-radius: 20px;
    }

    .orbit-badge {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }

    .orbit-badge svg {
        width: 18px;
        height: 18px;
    }

    .orbit-badge--top {
        top: 10px;
        right: -2px;
    }

    .orbit-badge--bottom {
        left: -2px;
        bottom: 14px;
    }

    .form-subtitle { margin-bottom: 24px; }
    .login-form,
    .password-form { gap: 18px; }
    .field-row { gap: 8px; }
}

@media (max-width: 380px) {
    .visual-panel { display: none; }
}
