/* ═══════════════════════════════════════════════════════════
   Metrolinx Property Advisors — Login Page
   ═══════════════════════════════════════════════════════════ */

:root {
    --orange:       #E8622A;
    --orange-dark:  #C94E1F;
    --orange-light: #FEF0E8;
    --orange-mid:   #FDDDD0;
    --grey:         #58595B;
    --grey-dark:    #2D2D2E;
    --surface:      #ffffff;
    --bg:           #F5F5F4;
    --text-h:       #2D2D2E;
    --text-b:       #58595B;
    --text-muted:   #9CA3AF;
    --border:       #E5E7EB;
    --radius-lg:    20px;
    --radius:       12px;
    --radius-sm:    8px;
    --shadow-card:  0 8px 32px -6px rgba(45,45,46,0.12), 0 2px 8px -2px rgba(45,45,46,0.06);
    --shadow-btn:   0 4px 14px -2px rgba(232,98,42,0.40);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-b);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

/* ─── Left brand panel ──────────────────────────────────── */
.brand-panel {
    flex: 0 0 48%;
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 5rem;
    position: relative;
    overflow: hidden;
}
/* Center the block, keep all children left-aligned as a unit */
.brand-panel > * { width: 100%; max-width: 380px; }
/* Orange top rule */
.brand-panel::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--orange) 0%, var(--orange-dark) 100%);
    z-index: 2;
}
/* Dot grid */
.brand-panel::after {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(232,98,42,0.07) 1px, transparent 1px);
    background-size: 28px 28px; pointer-events: none;
}
.brand-logo { display: block; height: 44px; width: 100%; max-width: 380px; object-fit: contain; object-position: left center; margin-bottom: 3.5rem; position: relative; z-index: 1; }
.brand-logo-placeholder {
    display: none; align-items: center; gap: 0.75rem; margin-bottom: 3.5rem;
    position: relative; z-index: 1;
}
.logo-icon {
    width: 40px; height: 40px; background: var(--orange-light);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; font-weight: 800; color: var(--orange);
}
.logo-text { font-size: 1.1rem; font-weight: 700; color: var(--grey-dark); }
.brand-tagline { position: relative; z-index: 1; }
.brand-tagline .eyebrow {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--orange); margin-bottom: 1rem;
}
.brand-tagline h2 {
    font-size: 2.6rem; font-weight: 800; color: var(--text-h);
    line-height: 1.15; letter-spacing: -0.03em; margin-bottom: 1.25rem;
}
.brand-tagline p { font-size: 1rem; color: var(--text-b); line-height: 1.7; max-width: 380px; }
.brand-features { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 0.85rem; position: relative; z-index: 1; }
.brand-feature { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; color: var(--text-b); }
.brand-feature i {
    width: 28px; height: 28px; background: var(--orange-light); color: var(--orange);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem; flex-shrink: 0;
}

/* ─── Right login panel ─────────────────────────────────── */
.login-panel {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    align-items: center; padding: 3rem 2rem; background: var(--bg); overflow-y: auto;
}
.login-inner {
    width: 100%; max-width: 420px;
    animation: slideUp 0.4s cubic-bezier(.22,.68,0,1.2) both;
}
@keyframes slideUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
.login-header { margin-bottom: 2.5rem; }
.login-header h1 { font-size: 1.75rem; font-weight: 800; color: var(--text-h); letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.login-header p  { font-size: 0.9rem; color: var(--text-b); line-height: 1.6; }

/* Floating label field */
.field { position: relative; margin-bottom: 1.25rem; }
.field label {
    position: absolute; top: 50%; left: 1rem;
    transform: translateY(-50%); font-size: 0.875rem; font-weight: 500;
    color: var(--text-muted); pointer-events: none; transition: all 0.2s ease;
    background: var(--surface); padding: 0 4px;
}
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label {
    top: 0; font-size: 0.72rem; color: var(--orange); font-weight: 600;
}
.field input {
    width: 100%; padding: 0.9rem 2.75rem 0.9rem 1rem; font-size: 0.95rem;
    font-family: 'Inter', monospace; letter-spacing: 0.3px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text-h);
    transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.field input::placeholder { color: transparent; }
.field input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(232,98,42,0.12); }
.field input.is-error { border-color: #ef4444; }
.field .field-icon {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}

/* Submit button */
.btn-primary-action {
    width: 100%; background: var(--orange); color: #fff; font-weight: 600;
    font-size: 0.95rem; padding: 0.9rem 1.5rem; border: none; border-radius: var(--radius);
    cursor: pointer; box-shadow: var(--shadow-btn); font-family: 'Inter', sans-serif;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.5rem;
}
.btn-primary-action:hover   { background: var(--orange-dark); transform: translateY(-2px); box-shadow: 0 8px 24px -4px rgba(232,98,42,0.45); }
.btn-primary-action:active  { transform: translateY(0); }
.btn-primary-action:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* Spinner */
.spinner {
    width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Alert boxes */
.alert-box {
    padding: 0.875rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem;
    font-weight: 500; display: none; align-items: center; gap: 0.6rem; margin-top: 1rem;
}
.alert-box.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-box.hint  { background: var(--orange-light); color: var(--orange-dark); border: 1px solid var(--orange-mid); display: flex; }

/* Code hint */
.code-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; display: flex; align-items: center; gap: 0.4rem; }
.code-hint code { font-family: monospace; background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; color: var(--text-b); }

/* Divider */
.divider { display: flex; align-items: center; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); margin: 1.5rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Footer */
.login-footer { margin-top: 2.5rem; font-size: 0.75rem; color: var(--text-muted); text-align: center; line-height: 1.7; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
    body { flex-direction: column; overflow: auto; }
    .brand-panel { flex: 0 0 auto; padding: 2.5rem 2rem 2rem; }
    .brand-tagline h2 { font-size: 1.8rem; }
    .brand-features { display: none; }
    .login-panel { padding: 2.5rem 1.5rem; }
}
@media (max-width: 600px) {
    .brand-panel { padding: 1.75rem 1.25rem 1.5rem; }
    .brand-tagline h2 { font-size: 1.45rem; }
    .brand-tagline p { font-size: 0.82rem; }
    .login-panel { padding: 2rem 1.1rem; }
    .login-header h1 { font-size: 1.45rem; }
}
@media (max-width: 480px) {
    .brand-panel { padding: 1.4rem 1rem 1.25rem; }
    .brand-tagline h2 { font-size: 1.25rem; }
    .login-panel { padding: 1.5rem 0.9rem; }
}
