/* ============================================================================
   POS · AUTH FUNNEL SHELL — shared by login.ftl, verify.ftl, select-tenant.ftl.
   Extracted from login.ftl so all three funnel steps render the SAME DS
   dark/indigo split layout (globe hero left, glass card right) and can never
   drift apart again. Authors entirely against DS var(--*) tokens.
   Page-specific rules (OTP input, tenant cards, country select, …) stay
   inline in each template.
   ============================================================================ */
:root { --grad-brand: linear-gradient(120deg, var(--brand), var(--brand-bright)); }

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

body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-body);
    overflow-x: hidden;
    min-height: 100vh;
}

.login-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 480px);
    min-height: 100vh;
}

/* ---- LEFT · brand hero ---------------------------------------------- */
.login-left {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 4vw, 56px);
    border-right: 1px solid var(--border-subtle);
    z-index: 1;
}
/* indigo ambient glow + faint blueprint grid backdrop */
.login-left::before {
    content: "";
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(820px 480px at 22% 8%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 60%),
        radial-gradient(680px 520px at 8% 104%, color-mix(in srgb, var(--brand-bright) 9%, transparent), transparent 58%);
}
.login-left::after {
    content: "";
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(174,184,208,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(174,184,208,0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(120% 90% at 30% 30%, #000, transparent 80%);
            mask-image: radial-gradient(120% 90% at 30% 30%, #000, transparent 80%);
}
.login-left > * { position: relative; z-index: 1; }

.lp-lock { display: flex; align-items: center; gap: 13px; margin-bottom: clamp(28px, 4vw, 44px); }
.lp-lock .lds-globe { color: var(--brand); flex: none; }
.lp-lock__wm { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em;
    font-size: 18px; color: var(--text-strong); line-height: 1.1; }
.lp-lock__wm b { color: var(--brand-bright); font-weight: 800; }
.lp-lock__sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 2px;
    text-transform: uppercase; color: var(--text-faint); margin-top: 5px; }

.info-panel { max-width: 520px; }

.info-panel h1 {
    font-family: var(--font-display);
    font-size: clamp(30px, 3.6vw, 46px);
    font-weight: 800;
    letter-spacing: -.9px;
    line-height: 1.04;
    color: var(--text-strong);
    margin-bottom: 1rem;
    max-width: 14ch;
}
.info-panel h1 em { font-style: normal; color: var(--brand-bright); }

.info-panel p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 48ch;
}

.feature-list { margin-top: 2.25rem; }

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0.9rem;
    padding: 12px 14px;
    background: var(--brand-tint);
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
}

.feature-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--brand) 16%, transparent);
    color: var(--brand-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feature-item span { font-size: 13.5px; font-weight: 500; color: var(--text-body); }

.lp-herofoot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin-top: clamp(28px, 4vw, 44px);
    font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.lp-herofoot__sep { width: 1px; height: 13px; background: var(--border-subtle); }

/* ---- RIGHT · card pane ------------------------------------------------ */
.login-right {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 4vw, 52px);
    z-index: 1;
}

.login-card {
    position: relative;
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
    padding: 34px 34px 28px;
    width: 100%;
    max-width: 430px;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}
/* brand edge — the ~10% accent moment */
.login-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
    border-top-left-radius: inherit; border-top-right-radius: inherit;
    background: var(--grad-brand);
}

.logo-section { margin-bottom: 2rem; }

.logo-section .lp-eyebrow {
    display: flex; align-items: center; gap: 7px;
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.4px;
    text-transform: uppercase; color: var(--brand-bright); margin-bottom: 12px;
}
.logo-section .lp-eyebrow svg { width: 13px; height: 13px; }

.logo-section h2 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--text-strong);
    margin-bottom: 0.4rem;
}

.logo-section p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.form-group { margin-bottom: 1.4rem; }

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--ink-900);
    color: var(--text-strong);
    transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.form-control::placeholder { color: var(--text-faint); }

.form-control:focus {
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 3px var(--ring);
    outline: none;
}

.btn-primary {
    background: var(--brand);
    color: var(--brand-contrast);
    padding: 13px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-primary:hover { background: var(--brand-bright); }
.btn-primary:active { transform: translateY(1px); }

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* UI-166: Visible focus ring for keyboard navigation on dark background */
.btn-primary:focus-visible {
    outline: 2px solid var(--text-strong);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px var(--ring);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.4rem 0;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-subtle);
}

.divider:not(:empty)::before { margin-right: 1rem; }
.divider:not(:empty)::after { margin-left: 1rem; }

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--brand-contrast);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 1.4rem;
    font-size: 13px;
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

.alert-danger {
    background: color-mix(in srgb, var(--error) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--error) 34%, transparent);
    color: var(--error);
}

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

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

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

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

    .login-left {
        order: 2;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
    }

    .login-right { order: 1; }

    .login-card { padding: 2rem; }

    .info-panel h1 { font-size: 32px; }
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 576px) {
    .login-card { padding: 1.5rem; }
    .logo-section h2 { font-size: 24px; }
}

/* UI-913: Respect prefers-reduced-motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .login-card { animation: none; }

    .loading-spinner {
        animation: none;
        border-top-color: var(--brand-contrast);
    }

    .alert { animation: none; }
}
