* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #65728a;
    --line: #dfe5ee;
    --soft: #f6f8fb;
    --panel: #ffffff;
    --primary: #1868db;
    --primary-dark: #0f4fab;
    --accent: #12a88a;
    --warning: #f59f00;
    --danger: #d63939;
    --shadow: 0 20px 60px rgba(23, 32, 51, 0.16);
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        linear-gradient(120deg, rgba(24, 104, 219, 0.12), rgba(18, 168, 138, 0.1)),
        linear-gradient(180deg, #f9fbff 0%, #eef3f8 100%);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
    align-items: stretch;
}

.auth-visual {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(28px, 5vw, 72px);
    background:
        linear-gradient(145deg, rgba(24, 104, 219, 0.96), rgba(10, 55, 120, 0.98)),
        #164f9f;
    color: #fff;
    overflow: hidden;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 20px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.auth-copy {
    max-width: 560px;
}

.auth-copy h1 {
    margin: 0 0 16px;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 0.98;
    letter-spacing: 0;
}

.auth-copy p {
    margin: 0;
    max-width: 460px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 17px;
    line-height: 1.65;
}

.phone-preview {
    width: min(360px, 100%);
    align-self: flex-end;
    border-radius: 34px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.phone-screen {
    border-radius: 24px;
    background: #f9fbff;
    color: var(--ink);
    padding: 18px;
    min-height: 380px;
}

.phone-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #eaf7f3;
    color: #08745f;
}

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.metric {
    min-height: 94px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 22px;
}

.order-row {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
}

.row-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #eef5ff;
    color: var(--primary);
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vw, 56px);
}

.auth-card {
    width: min(100%, 460px);
    padding: clamp(22px, 4vw, 36px);
    border: 1px solid rgba(223, 229, 238, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.auth-card h2 {
    margin: 18px 0 8px;
    font-size: clamp(26px, 5vw, 34px);
    line-height: 1.15;
    letter-spacing: 0;
}

.auth-card > p {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.55;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--soft);
}

.auth-tab {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
}

.auth-tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 8px 24px rgba(23, 32, 51, 0.08);
}

.form-grid {
    display: grid;
    gap: 14px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 800;
    color: #344056;
}

.field-control {
    position: relative;
}

.field-control i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #7b8aa2;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    outline: none;
}

.field input:focus {
    border-color: rgba(24, 104, 219, 0.7);
    box-shadow: 0 0 0 4px rgba(24, 104, 219, 0.1);
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #738199;
    cursor: pointer;
}

.field .has-toggle input {
    padding-right: 48px;
}

.btn-primary {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(24, 104, 219, 0.28);
}

.btn-primary:disabled {
    cursor: wait;
    opacity: 0.78;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    font-size: 14px;
}

.auth-actions a,
.link {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.status-note {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #eef8f5;
    color: #075f4e;
    line-height: 1.45;
    font-size: 14px;
}

.status-note.error {
    background: #fff1f1;
    color: var(--danger);
}

.status-note a {
    color: inherit;
    font-weight: 800;
}

.mini-list {
    display: grid;
    gap: 10px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 14px;
}

.mini-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-list i {
    color: var(--accent);
}

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

    .auth-visual {
        min-height: auto;
        padding: 26px 20px;
    }

    .auth-copy h1 {
        font-size: 34px;
    }

    .phone-preview {
        display: none;
    }

    .auth-panel {
        align-items: flex-start;
        padding: 20px;
    }

    .auth-card {
        border-radius: 20px;
    }
}

@media (max-width: 460px) {
    .auth-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-tabs {
        grid-template-columns: 1fr;
    }
}
