/**
 * Login — matches POS design system (slate + blue)
 * Font: Manrope (clean UI sans, consistent with product feel)
 */
:root {
    --pos-primary: #2563eb;
    --pos-primary-hover: #1d4ed8;
    --pos-sidebar: #0f172a;
    --pos-sidebar-2: #1e293b;
    --pos-text: #0f172a;
    --pos-muted: #64748b;
    --pos-faint: #94a3b8;
    --pos-border: #e2e8f0;
    --pos-border-strong: #cbd5e1;
    --pos-bg: #f8fafc;
    --pos-surface: #ffffff;
    --pos-danger: #dc2626;
    --pos-success: #059669;
    --font: 'Manrope', system-ui, sans-serif;
}

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

html, body { height: 100%; }

body.auth-page {
    font-family: var(--font);
    color: var(--pos-text);
    background: var(--pos-bg);
    -webkit-font-smoothing: antialiased;
}

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

.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
}

/* ── Left: product stage ── */
.login-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.75rem 2rem 1.5rem;
    color: #e2e8f0;
    overflow: hidden;
    background: var(--pos-sidebar);
}

.login-stage__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 55% at 15% 0%, rgba(37, 99, 235, 0.28), transparent 55%),
        radial-gradient(ellipse 60% 45% at 90% 100%, rgba(14, 165, 233, 0.12), transparent 50%),
        linear-gradient(165deg, #0f172a 0%, #111827 55%, #0b1220 100%);
    pointer-events: none;
}

.login-stage__top,
.login-stage__body,
.login-stage__foot {
    position: relative;
    z-index: 1;
}

.login-stage__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.login-logo__mark {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(147, 197, 253, 0.25);
}

.login-logo__text {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.login-stage__switch {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.login-stage__switch:hover {
    color: #e2e8f0;
    border-color: rgba(226, 232, 240, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.login-stage__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 36rem;
    padding: 2.5rem 0 1.5rem;
    animation: loginRise 0.65s ease both;
}

.login-stage__title {
    font-size: clamp(2rem, 3.4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: #f8fafc;
    margin-bottom: 0.85rem;
}

.login-stage__lead {
    font-size: 1.05rem;
    line-height: 1.55;
    color: #94a3b8;
    max-width: 28rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Terminal mockup — product visual */
.login-preview {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.55);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    backdrop-filter: blur(8px);
    animation: loginRise 0.75s ease 0.08s both;
}

.login-preview__chrome {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 0.9rem;
    background: rgba(30, 41, 59, 0.9);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.login-preview__chrome span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
}

.login-preview__chrome span:nth-child(1) { background: #f87171; }
.login-preview__chrome span:nth-child(2) { background: #fbbf24; }
.login-preview__chrome span:nth-child(3) { background: #34d399; }

.login-preview__chrome em {
    margin-left: auto;
    font-style: normal;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.login-preview__grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    min-height: 220px;
}

.login-preview__catalog {
    padding: 0.9rem;
    border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.login-preview__search {
    height: 2rem;
    border-radius: 7px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 0 0.7rem;
    margin-bottom: 0.75rem;
}

.login-preview__tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.login-preview__tiles div {
    aspect-ratio: 1 / 0.85;
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(51, 65, 85, 0.9), rgba(30, 41, 59, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.login-preview__tiles div:nth-child(2),
.login-preview__tiles div:nth-child(5) {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.35), rgba(30, 41, 59, 0.95));
}

.login-preview__cart {
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    background: rgba(15, 23, 42, 0.35);
}

.login-preview__cart strong {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
}

.login-preview__cart ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.login-preview__cart li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #cbd5e1;
    font-weight: 500;
}

.login-preview__cart li span:last-child {
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.login-preview__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    font-size: 0.8rem;
    color: #94a3b8;
}

.login-preview__total b {
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.login-preview__pay {
    margin-top: 0.15rem;
    height: 2.1rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--pos-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.login-stage__foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

.login-stage__foot a {
    color: #94a3b8;
    border-bottom: 1px solid transparent;
}

.login-stage__foot a:hover {
    color: #e2e8f0;
    border-bottom-color: rgba(226, 232, 240, 0.35);
}

/* ── Right: form ── */
.login-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--pos-surface);
}

.login-form {
    width: 100%;
    max-width: 22.5rem;
    animation: loginRise 0.6s ease 0.05s both;
}

.login-form__head {
    margin-bottom: 1.75rem;
}

.login-form__head h2 {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
}

.login-form__head p {
    color: var(--pos-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
}

.login-alert {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 1.15rem;
}

.login-alert--ok {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.login-alert--err {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.login-field {
    margin-bottom: 1.05rem;
}

.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.4rem;
}

.login-field__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.login-field__row label { margin-bottom: 0; }

.login-field__row a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pos-primary);
}

.login-field__row a:hover { text-decoration: underline; }

.login-field input[type="email"],
.login-field input[type="password"],
.login-pass input {
    width: 100%;
    height: 2.85rem;
    padding: 0 0.9rem;
    border: 1px solid var(--pos-border-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--pos-text);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-field input::placeholder { color: #94a3b8; font-weight: 450; }

.login-field input:hover { border-color: #94a3b8; }

.login-field input:focus {
    outline: none;
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.login-field.is-invalid input {
    border-color: #f87171;
}

.login-pass { position: relative; }
.login-pass input { padding-right: 4rem; }

.login-pass__btn {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    height: 2rem;
    padding: 0 0.55rem;
    border: 0;
    background: transparent;
    color: var(--pos-muted);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 6px;
}

.login-pass__btn:hover {
    color: var(--pos-text);
    background: #f1f5f9;
}

.login-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.15rem 0 1.15rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.login-check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--pos-primary);
    cursor: pointer;
}

.login-btn {
    width: 100%;
    height: 2.95rem;
    border: 0;
    border-radius: 8px;
    background: var(--pos-primary);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.login-btn:hover { background: var(--pos-primary-hover); }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: 0.7; cursor: wait; }

.login-demo {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--pos-border);
}

.login-demo > p {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pos-faint);
    margin-bottom: 0.65rem;
}

.login-demo__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.auth-demo-link {
    border: 1px solid var(--pos-border);
    background: #f8fafc;
    color: #334155;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 7px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.auth-demo-link:hover,
.auth-demo-link.is-filled {
    border-color: #93c5fd;
    color: var(--pos-primary-hover);
    background: #eff6ff;
}

@keyframes loginRise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .login-stage__body,
    .login-preview,
    .login-form { animation: none !important; }
}

@media (max-width: 960px) {
    .login {
        grid-template-columns: 1fr;
    }

    .login-stage {
        min-height: auto;
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .login-stage__body {
        padding: 1.25rem 0 0.75rem;
    }

    .login-stage__title {
        font-size: 1.75rem;
    }

    .login-preview {
        display: none;
    }

    .login-form-wrap {
        align-items: flex-start;
        padding: 1.75rem 1.25rem 2.5rem;
        background: var(--pos-bg);
    }

    .login-form {
        background: #fff;
        border: 1px solid var(--pos-border);
        border-radius: 12px;
        padding: 1.35rem 1.2rem 1.25rem;
        max-width: none;
    }
}
