:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --canvas: #f8fafc;
    --danger: #b91c1c;
    --ok: #047857;
    color-scheme: light;
}

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

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

body.login-body {
    font-family: Inter, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

button,
input,
a {
    font: inherit;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 0.95fr);
    min-height: 100vh;
}

.login-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 48px 56px;
    color: #fff;
    background:
        radial-gradient(circle at 12% 18%, rgba(37, 99, 235, 0.55), transparent 36%),
        radial-gradient(circle at 88% 80%, rgba(125, 211, 252, 0.18), transparent 32%),
        #0f172a;
}

.login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 78%);
    pointer-events: none;
}

.brand-glow,
.brand-top,
.brand-copy,
.brand-stage {
    position: relative;
    z-index: 1;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.brand-name {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.brand-by {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
    opacity: 0.72;
}

.brand-copy h1 {
    max-width: 520px;
    margin: 0;
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.12;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.brand-copy p {
    max-width: 440px;
    margin: 16px 0 0;
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.6;
}

.brand-stage {
    display: grid;
    gap: 16px;
    max-width: 380px;
}

.pass-card,
.reward-chip {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.22);
    backdrop-filter: blur(10px);
}

.pass-card {
    border-radius: 20px;
    padding: 20px;
}

.pass-top,
.stamps {
    display: flex;
    align-items: center;
}

.pass-top {
    justify-content: space-between;
    margin-bottom: 22px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
}

.qr-mark {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background:
        linear-gradient(#fff 0 0) 3px 3px / 6px 6px no-repeat,
        linear-gradient(#fff 0 0) 19px 3px / 6px 6px no-repeat,
        linear-gradient(#fff 0 0) 3px 19px / 6px 6px no-repeat,
        linear-gradient(#fff 0 0) 12px 12px / 4px 4px no-repeat,
        linear-gradient(#fff 0 0) 19px 19px / 6px 6px no-repeat;
    opacity: 0.9;
}

.pass-card strong {
    display: block;
    font-size: 20px;
    letter-spacing: -0.03em;
}

.pass-card p {
    margin: 4px 0 18px;
    color: #cbd5e1;
    font-size: 14px;
}

.stamps {
    gap: 8px;
}

.stamps span {
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.stamps span.is-filled {
    border-color: transparent;
    background: #60a5fa;
}

.reward-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    margin-left: 36px;
    padding: 12px 16px;
    border-radius: 16px;
}

.chip-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    color: #fff;
}

.chip-icon svg {
    width: 28px;
    height: 28px;
}

.reward-chip strong,
.reward-chip small {
    display: block;
}

.reward-chip strong {
    font-size: 14px;
}

.reward-chip small {
    color: #cbd5e1;
    font-size: 12px;
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 24px;
    background: #fff;
}

.login-compact {
    display: none;
}

.login-card {
    width: min(100%, 420px);
    margin: 0 auto;
}

.login-heading h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.login-heading p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.form-alert {
    margin-top: 24px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.form-alert.is-error {
    color: var(--danger);
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.form-alert.is-success {
    color: var(--ok);
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.form-alert.is-info {
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #dbeafe;
}

form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.field {
    display: grid;
    gap: 8px;
}

.field label,
.field-label-row a,
.remember,
.login-note {
    font-size: 14px;
}

.field label {
    font-weight: 600;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field-label-row a {
    color: var(--blue);
    font-weight: 500;
    text-decoration: none;
}

.field-label-row a:hover {
    color: var(--blue-dark);
}

.text-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input::placeholder {
    color: #94a3b8;
}

.text-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.field.has-error .text-input {
    border-color: #dc2626;
}

.field.has-error .text-input:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.password-wrap {
    position: relative;
}

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

.password-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--ink);
    background: var(--canvas);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.password-toggle .icon-hide {
    display: none;
}

.password-toggle.is-visible .icon-show {
    display: none;
}

.password-toggle.is-visible .icon-hide {
    display: block;
}

.field-error {
    min-height: 18px;
    margin: 0;
    color: var(--danger);
    font-size: 13px;
}

.field-error:empty {
    display: none;
}

.remember {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
    cursor: pointer;
}

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

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: var(--blue);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn-login:hover {
    background: var(--blue-dark);
    color: #fff;
}

.btn-login:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.btn-login:disabled {
    cursor: wait;
    opacity: 0.85;
}

.btn-login-wait {
    display: none;
    align-items: center;
    gap: 8px;
}

.btn-login.is-loading .btn-login-label {
    display: none;
}

.btn-login.is-loading .btn-login-wait {
    display: inline-flex;
}

.btn-login-ghost {
    margin-top: 8px;
    background: #fff;
    color: var(--blue);
    border: 1px solid #bfdbfe;
}

.btn-login-ghost:hover {
    background: #eff6ff;
    color: var(--blue-dark);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.login-note {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
}

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

@media (max-width: 991.98px) {
    .login-shell {
        display: block;
    }

    .login-brand {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 28px 20px 40px;
        background: var(--canvas);
    }

    .login-compact {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: min(100%, 420px);
        margin: 0 auto 28px;
    }

    .login-compact .brand-mark {
        background: var(--blue);
    }

    .login-compact .brand-name {
        color: var(--ink);
    }

    .login-compact p {
        margin: 0;
        color: var(--muted);
        font-size: 14px;
        line-height: 1.5;
    }

    .login-card {
        padding: 28px 22px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }
}

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