:root {
    --ink: #111827;
    --muted: #64748b;
    --line: #dbe3ee;
    --panel: #ffffff;
    --page: #f4f7fb;
    --navy: #122033;
    --navy-2: #183a56;
    --blue: #2563eb;
    --blue-2: #1d4ed8;
    --amber: #f2b544;
    --green: #15803d;
    --danger: #b42318;
    --danger-bg: #fff4f2;
    --shadow: 0 24px 70px rgb(15 23 42 / 0.14);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
}

.hidden {
    display: none !important;
}

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
}

.brand-panel {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 34px clamp(34px, 5vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        linear-gradient(90deg, transparent 0 31px, rgb(255 255 255 / 0.055) 32px),
        linear-gradient(0deg, transparent 0 31px, rgb(255 255 255 / 0.055) 32px),
        linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 58%, #102235 100%);
    background-size: 32px 32px, 32px 32px, auto;
}

.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(112deg, transparent 0 66%, rgb(242 181 68 / 0.10) 66.1% 66.55%, transparent 66.65%),
        linear-gradient(112deg, transparent 0 73%, rgb(255 255 255 / 0.05) 73.1% 73.28%, transparent 73.38%);
    pointer-events: none;
}

.brand-panel::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 8px;
    background: linear-gradient(180deg, var(--amber), #d88f24);
    box-shadow: -18px 0 42px rgb(242 181 68 / 0.12);
}

.brand-topbar,
.brand-content,
.brand-footer {
    position: relative;
    z-index: 1;
}

.brand-topbar,
.brand-footer {
    width: min(100%, 620px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.back-link,
.environment-badge {
    height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 700;
}

.back-link {
    padding: 0 13px;
    border: 1px solid rgb(255 255 255 / 0.18);
    background: rgb(255 255 255 / 0.06);
    color: #eef5ff;
    transition: background 160ms ease, border-color 160ms ease;
}

.back-link:hover {
    background: rgb(255 255 255 / 0.12);
    border-color: rgb(255 255 255 / 0.28);
}

.back-link svg,
.environment-badge svg {
    width: 17px;
    height: 17px;
}

.environment-badge {
    padding: 0 12px;
    border: 1px solid rgb(34 197 94 / 0.32);
    background: rgb(34 197 94 / 0.12);
    color: #d8ffe4;
}

.brand-content {
    width: min(100%, 620px);
}

.identity-lockup {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: clamp(38px, 7vh, 74px);
}

.logo-box {
    width: 90px;
    height: 90px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 48px rgb(0 0 0 / 0.24);
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.brand-panel .eyebrow {
    color: #ffd57a;
}

.identity-lockup h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3.6vw, 2.9rem);
    line-height: 1;
    letter-spacing: -0.02em;
}

.brand-copy h2 {
    max-width: 600px;
    margin: 0;
    font-size: clamp(3rem, 5.4vw, 5rem);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.brand-copy p {
    max-width: 440px;
    margin: 24px 0 0;
    color: #d5deeb;
    font-size: 1.03rem;
    line-height: 1.7;
}

.operations-panel {
    width: min(100%, 520px);
    margin-top: clamp(34px, 6vh, 62px);
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 8px;
    background: rgb(255 255 255 / 0.09);
    box-shadow: 0 22px 58px rgb(0 0 0 / 0.17);
    backdrop-filter: blur(14px);
}

.panel-header {
    min-height: 76px;
    padding: 18px 18px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgb(255 255 255 / 0.12);
}

.panel-header strong {
    display: block;
    margin-top: 4px;
    font-size: 1.02rem;
}

.panel-kicker {
    display: block;
    color: #bfd2e7;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.panel-status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 7px 11px;
    color: #dcffe9;
    background: rgb(21 128 61 / 0.18);
    font-size: 0.78rem;
    font-weight: 800;
}

.panel-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #4ade80;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid rgb(255 255 255 / 0.12);
}

.metric {
    padding: 16px 18px;
}

.metric + .metric {
    border-left: 1px solid rgb(255 255 255 / 0.12);
}

.metric span {
    display: block;
    color: #b8c8da;
    font-size: 0.78rem;
    font-weight: 700;
}

.metric strong {
    display: block;
    margin-top: 7px;
    font-size: 1.28rem;
}

.activity-list {
    padding: 8px;
}

.activity-row {
    min-height: 66px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
}

.activity-row + .activity-row {
    margin-top: 2px;
}

.activity-row strong,
.activity-row span {
    display: block;
}

.activity-row strong {
    font-size: 0.92rem;
}

.activity-row span {
    margin-top: 3px;
    color: #c5d3e2;
    font-size: 0.8rem;
}

.row-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: grid;
    place-items: center;
}

.row-icon svg,
.row-arrow {
    width: 18px;
    height: 18px;
}

.row-icon.amber {
    color: #ffd57a;
    background: rgb(242 181 68 / 0.16);
}

.row-icon.blue {
    color: #bcd4ff;
    background: rgb(37 99 235 / 0.18);
}

.row-icon.green {
    color: #b7f3ca;
    background: rgb(21 128 61 / 0.18);
}

.row-arrow {
    color: #9db2c8;
}

.brand-footer {
    color: #c7d4e4;
    font-size: 0.82rem;
    font-weight: 700;
}

.login-panel {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgb(255 255 255 / 0.72), rgb(255 255 255 / 0) 38%),
        var(--page);
}

.mobile-header {
    display: none;
}

.login-wrap {
    width: min(100% - 48px, 430px);
    margin: auto;
    padding: 42px 0;
}

.login-heading {
    margin-bottom: 24px;
}

.login-heading h2 {
    margin: 0;
    color: #0d1726;
    font-size: clamp(2.1rem, 5vw, 3rem);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.login-heading p {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

.alert,
.login-form,
.recovery-note {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.alert {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding: 13px 14px;
    color: var(--danger);
    background: var(--danger-bg);
    border-color: #ffd7d2;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.alert strong,
.alert span {
    display: block;
}

.alert strong {
    margin-bottom: 2px;
    font-size: 0.9rem;
}

.alert span {
    color: #7a271a;
    font-size: 0.86rem;
}

.login-form {
    padding: clamp(18px, 4vw, 24px);
    box-shadow: var(--shadow);
}

.field {
    display: block;
}

.field + .field {
    margin-top: 17px;
}

.field > span {
    display: block;
    margin-bottom: 8px;
    color: #283548;
    font-size: 0.88rem;
    font-weight: 800;
}

.input-shell {
    position: relative;
}

.input-shell > svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 20px;
    height: 20px;
    color: #8a98aa;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-shell input {
    width: 100%;
    height: 50px;
    padding: 0 48px 0 46px;
    border: 1px solid #cbd6e2;
    border-radius: 8px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font-size: 0.98rem;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-shell input::placeholder {
    color: #9aa8b8;
}

.input-shell input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgb(37 99 235 / 0.13);
}

.icon-button {
    position: absolute;
    inset: 0 0 0 auto;
    width: 48px;
    height: 50px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.icon-button:hover {
    color: #111827;
}

.icon-button svg {
    width: 20px;
    height: 20px;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 16px 0 22px;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 700;
}

.remember-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.text-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--blue-2);
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
}

.text-button:hover {
    color: #173c9b;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.submit-button {
    width: 100%;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 16px 32px rgb(37 99 235 / 0.22);
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.submit-button:hover {
    background: var(--blue-2);
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgb(37 99 235 / 0.27);
}

.submit-button:disabled {
    cursor: not-allowed;
    transform: none;
    background: #94a3b8;
    box-shadow: none;
}

.submit-button span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.submit-button svg {
    width: 19px;
    height: 19px;
}

.spinner {
    animation: spin 0.8s linear infinite;
}

.spinner circle {
    fill: none;
    stroke: rgb(255 255 255 / 0.32);
    stroke-width: 4;
}

.spinner path {
    fill: none;
    stroke: #fff;
    stroke-linecap: round;
    stroke-width: 4;
}

.recovery-note {
    margin: 14px 0 0;
    padding: 12px 14px;
    color: #7c4a03;
    background: #fff8e8;
    border-color: #f7dca1;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.45;
}

.login-footer {
    padding: 0 24px 24px;
    color: #718096;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
}

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

@media (max-width: 1040px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .mobile-header {
        min-height: 72px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 16px 20px 0;
    }

    .mobile-header .back-link {
        border-color: var(--line);
        background: #fff;
        color: #253247;
        box-shadow: 0 8px 20px rgb(15 23 42 / 0.06);
    }

    .mobile-header img {
        width: 48px;
        height: 48px;
        object-fit: contain;
    }

    .login-wrap {
        width: min(100% - 36px, 440px);
        padding: 28px 0 34px;
    }
}

@media (max-width: 520px) {
    .login-panel {
        min-height: 100dvh;
    }

    .mobile-header {
        padding-inline: 14px;
    }

    .mobile-header img {
        width: 42px;
        height: 42px;
    }

    .login-wrap {
        width: min(100% - 28px, 440px);
        padding-top: 24px;
    }

    .login-heading {
        margin-bottom: 20px;
    }

    .login-heading h2 {
        font-size: 2.16rem;
    }

    .form-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}
