/* ═══════════════════════════════════════════════════════════
   FloorRadar — Login page
   Cohesive with /demo (indigo primary, Inter, atmospheric gradient)
   Two-column on desktop (brand + form), single-column on mobile.
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --primary-deep: #4338CA;
    --bg-base: #FFFFFF;
    --bg-soft: #F8F9FB;
    --bg-muted: #F1F2F7;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #64748B;
    --text-muted: #94A3B8;
    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-focus: rgba(99, 102, 241, 0.35);
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 40px rgba(15, 23, 42, 0.08);
    --shadow-cta: 0 4px 14px rgba(99, 102, 241, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); }

/* ─── Page background ─────────────────────────────────── */
.page-bg {
    position: fixed; inset: 0; z-index: -1;
    pointer-events: none;
}
.page-gradient {
    position: absolute; inset: 0;
    background:
      radial-gradient(ellipse 70% 60% at 25% 15%, rgba(99, 102, 241, 0.18), transparent 60%),
      radial-gradient(ellipse 60% 50% at 80% 30%, rgba(139, 92, 246, 0.14), transparent 70%),
      radial-gradient(ellipse 60% 70% at 60% 90%, rgba(99, 102, 241, 0.10), transparent 70%),
      linear-gradient(180deg, #FFFFFF 0%, #FAFBFE 100%);
}
.page-grid {
    position: absolute; inset: 0; opacity: 0.45;
    background-image:
      linear-gradient(rgba(99, 102, 241, 0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(99, 102, 241, 0.06) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
}

/* ─── Page layout ─────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 32px 20px;
}
.login-shell {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 56px;
    align-items: center;
    width: 100%;
    max-width: 1080px;
}

/* ─── Brand panel (left) ──────────────────────────────── */
.brand-panel {
    padding: 24px 0;
}
.brand {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--text-primary); font-weight: 700; font-size: 1.1rem;
    letter-spacing: -0.01em;
    margin-bottom: 36px;
}
.brand-icon { font-size: 1.45rem; line-height: 1; }
.brand-tld { color: var(--text-tertiary); font-weight: 600; }
.brand:hover .brand-name { color: var(--primary-hover); }

.brand-pitch {
    font-size: clamp(1.65rem, 3.4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 28px;
    max-width: 480px;
}
.brand-pitch-accent {
    display: block;
    background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-top: 4px;
}

.brand-points {
    list-style: none;
    display: flex; flex-direction: column; gap: 14px;
    max-width: 460px;
    margin-bottom: 32px;
}
.brand-points li {
    display: flex; align-items: flex-start; gap: 12px;
    color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5;
}
.brand-points .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--primary);
    margin-top: 9px; flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.brand-foot {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ─── Form panel (right) ──────────────────────────────── */
.form-panel {
    display: flex; flex-direction: column; align-items: stretch;
}
.form-card {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}
.form-header {
    text-align: center;
    margin-bottom: 28px;
}
.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-sub {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.error-msg {
    display: none;
    background: rgba(220, 38, 38, 0.08);
    color: #B91C1C;
    border: 1px solid rgba(220, 38, 38, 0.16);
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 18px;
}

.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 0.78rem; font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.input-wrapper { position: relative; }
.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--text-muted);
    pointer-events: none;
}
.form-input {
    width: 100%;
    padding: 13px 14px 13px 42px;
    background: var(--bg-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    min-height: 48px;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
    outline: none;
    background: var(--bg-base);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.login-btn {
    position: relative;
    width: 100%;
    padding: 13px;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: var(--shadow-cta);
    min-height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
}
.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
}
.login-btn:active { transform: translateY(0); }
.login-btn:disabled {
    opacity: 0.6; cursor: not-allowed; transform: none;
    box-shadow: var(--shadow-cta);
}
.login-btn[data-loading="true"] .btn-label { visibility: hidden; }
.btn-spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    position: absolute;
    animation: spin 0.6s linear infinite;
}
.login-btn[data-loading="true"] .btn-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-aside {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.88rem;
}
.form-aside a { font-weight: 600; }

/* ─── 6-digit OTP entry (shown after magic-link send) ──── */
.otp-form { margin-top: 18px; }
.otp-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: stretch;
}
.otp-input {
    padding: 13px 14px;
    background: var(--bg-muted);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-align: center;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    min-height: 48px;
}
.otp-input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0.35em;
    font-weight: 500;
}
.otp-input:focus {
    outline: none;
    background: var(--bg-base);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.otp-input:disabled { opacity: 0.6; cursor: not-allowed; }
.otp-btn {
    position: relative;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: var(--shadow-cta);
    min-height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
}
.otp-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55); }
.otp-btn:active { transform: translateY(0); }
.otp-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: var(--shadow-cta); }
.otp-btn[data-loading="true"] .btn-label { visibility: hidden; }
.otp-btn[data-loading="true"] .btn-spinner { display: block; }

.form-version {
    margin-top: 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ─── OAuth + magic link additions ────────────────────── */
.oauth-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 18px;
}
.oauth-btn:hover {
    background: var(--bg-soft);
    border-color: rgba(15, 23, 42, 0.24);
}
.oauth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-tertiary);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 18px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-toggle {
    text-align: center;
    margin-top: 14px;
    font-size: 0.88rem;
}
.auth-toggle a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}
.auth-toggle a:hover { text-decoration: underline; }

.success-msg {
    display: none;
    background: rgba(21, 128, 61, 0.08);
    border: 1px solid rgba(21, 128, 61, 0.22);
    color: #15803D;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 880px) {
    .login-shell {
        grid-template-columns: 1fr;
        gap: 32px;
        max-width: 480px;
    }
    .brand-panel {
        padding: 0;
        text-align: center;
    }
    .brand { margin-bottom: 16px; }
    .brand-pitch { margin-left: auto; margin-right: auto; max-width: none; }
    .brand-points {
        margin-left: auto; margin-right: auto;
        text-align: left;
    }
    .brand-foot { display: none; }
}

@media (max-width: 480px) {
    .login-page { padding: 16px; }
    .form-card { padding: 28px 22px 24px; border-radius: 16px; }
    .form-title { font-size: 1.3rem; }
    .brand-points li { font-size: 0.9rem; }
}
