/* ═══════════════════════════════════════════════════════════════════════
   Nelabs Customer Portal — shared stylesheet
   Used by: login.html, onboarding.html, dashboard.html
   Same design tokens as the main site.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --primary: #1A56DB;
  --primary-light: #3B7AFF;
  --primary-dark: #1344b0;
  --navy: #0F2E6B;
  --soft-blue: #E8F0FE;
  --off-white: #F7F9FF;
  --white: #FFFFFF;
  --near-black: #1A1A2E;
  --text-body: #2D3A5A;
  --text-muted: #6B7A99;
  --text-light: #8B9BB5;
  --border-subtle: rgba(26,86,219,0.08);
  --border-light: #E2E8F0;
  --success: #10B981;
  --success-dark: #059669;
  --warn: #F59E0B;
  --danger: #DC2626;
  --shadow-sm: 0 2px 12px rgba(15,46,107,0.04);
  --shadow-md: 0 8px 32px rgba(15,46,107,0.06);
  --shadow-lg: 0 20px 60px rgba(15,46,107,0.08);
  --shadow-xl: 0 32px 80px rgba(15,46,107,0.1);
  --shadow-glow: 0 8px 40px rgba(26,86,219,0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --font-heading: 'Satoshi', 'Inter', -apple-system, sans-serif;
  --font-body: 'Erode', 'Georgia', 'Times New Roman', serif;
  --font-alt: 'Inter', -apple-system, sans-serif;
  --max-w: 1200px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-alt);
  color: var(--text-body);
  background: var(--off-white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.navbar-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.navbar-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-heading); font-weight: 700; font-size: 1.3rem;
  color: var(--navy); text-decoration: none;
}
.navbar-logo svg { width: 30px; height: 30px; }
.navbar-links { display: flex; align-items: center; gap: 30px; }
.navbar-links a {
  font-size: 0.88rem; font-weight: 500; color: var(--text-muted);
  text-decoration: none; position: relative; transition: color .25s;
}
.navbar-links a:hover { color: var(--primary); }
.nav-login {
  padding: 9px 22px; border-radius: 999px;
  background: var(--navy); color: var(--white) !important;
  font-weight: 600 !important; font-size: 0.85rem !important;
  transition: background .25s, transform .25s;
}
.nav-login:hover { background: var(--primary) !important; transform: translateY(-1px); }
.mobile-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; color: var(--navy);
}
.mobile-toggle svg { width: 24px; height: 24px; }

/* ── Page shell ─────────────────────────────────────────────────────── */
.portal-main { flex: 1; width: 100%; }
.portal-wrap { max-width: var(--max-w); margin: 0 auto; padding: 40px 32px 80px; }
.portal-wrap.narrow { max-width: 880px; }

.page-head { margin-bottom: 32px; }
.page-eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 10px;
}
.page-title {
  font-family: var(--font-heading); font-weight: 900;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.15;
  color: var(--navy); margin-bottom: 10px;
}
.page-sub { font-size: 0.98rem; color: var(--text-muted); max-width: 62ch; }

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 28px; margin-bottom: 22px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.card-title { font-family: var(--font-heading); font-weight: 700; font-size: 1.08rem; color: var(--navy); }
.card-hint { font-size: 0.82rem; color: var(--text-light); }

/* ── Forms ──────────────────────────────────────────────────────────── */
.field { display: block; margin-bottom: 18px; }
.field-label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--navy); margin-bottom: 7px;
}
.field-label .req { color: var(--danger); }
.field-input {
  width: 100%; padding: 13px 15px; background: var(--white);
  border: 1.5px solid var(--border-light); border-radius: var(--radius-md);
  font-size: 0.95rem; color: var(--text-body); outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.field-input::placeholder { color: var(--text-light); }
.field-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.09); }
.field-input:disabled { background: var(--off-white); color: var(--text-light); cursor: not-allowed; }
.field-help { display: block; margin-top: 6px; font-size: 0.74rem; color: var(--text-light); }
.field-error { display: block; margin-top: 6px; font-size: 0.74rem; color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border: none; border-radius: var(--radius-md);
  font-family: var(--font-alt); font-size: 0.92rem; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .25s, box-shadow .25s, background .25s, opacity .25s;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.btn-primary { background: var(--primary); color: var(--white); box-shadow: 0 6px 20px rgba(26,86,219,0.26); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-2px); }

.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover:not(:disabled) { background: var(--primary); transform: translateY(-2px); }

.btn-ghost {
  background: var(--white); color: var(--navy);
  border: 1.5px solid var(--border-light);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

.btn-google {
  background: var(--white); color: var(--near-black);
  border: 1.5px solid var(--border-light); width: 100%;
}
.btn-google:hover:not(:disabled) { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.btn-google svg { width: 19px; height: 19px; }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 0.82rem; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius-md);
  font-size: 0.85rem; margin-bottom: 18px; line-height: 1.5;
}
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert-error   { background: rgba(220,38,38,0.06); border: 1px solid rgba(220,38,38,0.18); color: #B91C1C; }
.alert-success { background: rgba(16,185,129,0.07); border: 1px solid rgba(16,185,129,0.2); color: #047857; }
.alert-info    { background: var(--soft-blue); border: 1px solid rgba(26,86,219,0.14); color: var(--navy); }
.alert-warn    { background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.22); color: #92400E; }
.alert[hidden] { display: none; }

/* ── Login page ─────────────────────────────────────────────────────── */
.auth-shell {
  flex: 1; display: grid; grid-template-columns: 1.05fr 0.95fr;
  min-height: calc(100vh - 73px);
}

.auth-brand {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--navy) 0%, #123a8a 55%, var(--primary) 100%);
  color: var(--white); padding: 60px 64px;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-brand::before,
.auth-brand::after {
  content: ''; position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 68%);
  pointer-events: none;
}
.auth-brand::before { width: 520px; height: 520px; top: -190px; right: -190px; }
.auth-brand::after  { width: 400px; height: 400px; bottom: -170px; left: -140px; }
.auth-brand-inner { position: relative; z-index: 1; max-width: 460px; }

.auth-brand h1 {
  font-family: var(--font-heading); font-weight: 900;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem); line-height: 1.14;
  margin-bottom: 18px;
}
.auth-brand p { font-size: 1rem; color: rgba(255,255,255,0.82); margin-bottom: 34px; max-width: 44ch; }

.auth-points { list-style: none; display: flex; flex-direction: column; gap: 17px; }
.auth-points li { display: flex; align-items: flex-start; gap: 13px; font-size: 0.92rem; color: rgba(255,255,255,0.9); }
.auth-points .tick {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  background: rgba(255,255,255,0.16); display: flex; align-items: center; justify-content: center;
}
.auth-points .tick svg { width: 13px; height: 13px; stroke: var(--white); }

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px; background: var(--off-white);
}
.auth-card {
  width: 100%; max-width: 430px; background: var(--white);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: 36px;
}
.auth-card h2 {
  font-family: var(--font-heading); font-weight: 900;
  font-size: 1.5rem; color: var(--navy); margin-bottom: 6px;
}
.auth-card .auth-lead { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 26px; }

.auth-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0; color: var(--text-light); font-size: 0.76rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-light);
}

.auth-switch { text-align: center; margin-top: 22px; font-size: 0.85rem; color: var(--text-muted); }
.auth-switch a { font-weight: 600; }

.auth-forgot { text-align: right; margin: -8px 0 18px; }
.auth-forgot a { font-size: 0.79rem; font-weight: 500; }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: var(--white);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Status pill ────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-live      { background: rgba(16,185,129,0.1);  color: #047857; }
.pill-progress  { background: rgba(26,86,219,0.1);   color: var(--primary); }
.pill-testing   { background: rgba(245,158,11,0.12); color: #92400E; }
.pill-onboarding{ background: rgba(107,122,153,0.12);color: var(--text-muted); }

/* ── Footer ─────────────────────────────────────────────────────────── */
.portal-footer {
  border-top: 1px solid var(--border-subtle); background: var(--white);
  padding: 22px 32px; text-align: center;
  font-size: 0.78rem; color: var(--text-light);
}
.portal-footer a { color: var(--text-muted); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .auth-shell { grid-template-columns: 1fr; min-height: auto; }
  .auth-brand { padding: 44px 32px; }
  .auth-brand-inner { max-width: 100%; }
  .auth-points { gap: 13px; }
  .navbar-links { gap: 22px; }
}

@media (max-width: 768px) {
  .navbar-inner { padding: 14px 20px; }
  .navbar-links { gap: 16px; }
  .navbar-links a:not(.nav-login) { display: none; }
  .portal-wrap { padding: 28px 20px 60px; }
  .card { padding: 22px 18px; }
  .auth-card { padding: 28px 22px; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .navbar-inner { padding: 12px 16px; }
  .portal-wrap { padding: 22px 16px 50px; }
  .auth-brand { padding: 34px 22px; }
  .auth-brand h1 { font-size: 1.55rem; }
  .auth-card { padding: 24px 18px; border-radius: var(--radius-lg); }
  .card { padding: 20px 16px; border-radius: var(--radius-md); }
  .btn-row .btn { flex: 1 1 100%; }
}
