:root {
  --rb-navy: #0a2540;
  --rb-blue: #0066cc;
  --rb-gold: #c9a227;
  --rb-light-gray: #f5f7fa;
  --rb-border: #e2e8f0;
  --rb-text-dark: #0f172a;
  --rb-text-medium: #475569;
  --rb-text-light: #94a3b8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--rb-light-gray);
  color: var(--rb-text-dark);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* === Login layout === */
.login-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

/* Left brand panel */
.login-brand {
  background: linear-gradient(135deg, var(--rb-navy) 0%, #0d3a5c 60%, #0066cc 100%);
  color: #ffffff;
  padding: 3rem 3.5rem;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-brand::before {
  content: ''; position: absolute; top: -10%; right: -10%;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.15) 0%, transparent 70%);
}
.login-brand::after {
  content: ''; position: absolute; bottom: -20%; left: -10%;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
}
.brand-logo {
  position: relative; z-index: 2;
  display: inline-block;
  background: transparent;
}
.brand-logo-mark {
  display: block;
  height: 46px;
  width: auto;
  max-width: 320px;
  background: transparent;
}
.brand-logo-mark .badge { fill: #dc2626; }
.brand-logo-mark .badge-letter { fill: #ffffff; font-family: 'Inter', system-ui, -apple-system, sans-serif; font-weight: 800; }
.brand-logo-mark .wordmark { fill: #ffffff; font-family: 'Inter', system-ui, -apple-system, sans-serif; font-weight: 700; }
.brand-logo-mark .accent { fill: #c9a227; font-family: 'Inter', system-ui, -apple-system, sans-serif; font-weight: 700; }

/* Live-data chart preview embedded in brand panel */
.brand-chart-preview {
  position: relative; z-index: 1;
  margin: 1.75rem 0 0;
  max-width: 520px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(0, 102, 204, 0.18);
  background: linear-gradient(180deg, #0a1f3a 0%, #06172d 100%);
}
.brand-chart-preview::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(201, 162, 39, 0.12), transparent 55%),
    radial-gradient(circle at bottom left, rgba(0, 102, 204, 0.22), transparent 55%);
}
.live-chart { display: block; width: 100%; height: auto; }

/* Animated chart lines */
.live-chart .trend-line {
  fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1800; stroke-dashoffset: 1800;
  filter: drop-shadow(0 0 4px currentColor);
  animation: drawTrend 9s cubic-bezier(.6,.05,.3,1) infinite;
}
.live-chart .trend-bod  { stroke: #3b82f6; animation-delay: 0s; }
.live-chart .trend-cod  { stroke: #10b981; animation-delay: 0.35s; }
.live-chart .trend-tss  { stroke: #67e8f9; animation-delay: 0.7s; }
@keyframes drawTrend {
  0%   { stroke-dashoffset: 1800; opacity: 0; }
  10%  { opacity: 1; }
  55%  { stroke-dashoffset: 0; opacity: 1; }
  80%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -1800; opacity: 0; }
}

/* Pulsing data point */
.live-chart .pt {
  animation: pointPulse 2.4s ease-in-out infinite;
  transform-origin: center;
}
.live-chart .pt:nth-child(2n) { animation-delay: 0.5s; }
.live-chart .pt:nth-child(3n) { animation-delay: 1s; }
@keyframes pointPulse {
  0%, 100% { r: 2.5; opacity: 0.95; }
  50% { r: 3.4; opacity: 1; }
}

/* Live "now" cursor sweeping across chart */
.live-chart .now-cursor {
  stroke: #fbbf24; stroke-width: 1.2; stroke-dasharray: 3 4;
  animation: cursorSweep 6s ease-in-out infinite;
}
@keyframes cursorSweep {
  0%   { transform: translateX(-460px); opacity: 0; }
  10%  { opacity: 0.55; }
  90%  { opacity: 0.55; }
  100% { transform: translateX(0); opacity: 0; }
}

/* Live indicator dot in title area */
.live-chart .live-led {
  animation: ledPulse 1.6s ease-in-out infinite;
  transform-origin: center;
}
@keyframes ledPulse {
  0%, 100% { opacity: 0.9; r: 4; }
  50% { opacity: 1; r: 5.2; }
}

/* "Last updated" tag fades in/out */
.live-chart .last-update {
  animation: tagBlink 5s ease-in-out infinite;
}
@keyframes tagBlink {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
.brand-chart-caption {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 0.55rem;
  margin-top: 0.625rem;
  font-size: 0.8125rem; font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  max-width: 480px;
}
.brand-chart-caption .live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: liveDot 2.2s ease-in-out infinite;
}
@keyframes liveDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); transform: scale(1); }
  50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); transform: scale(1.08); }
}
.brand-content { position: relative; z-index: 1; }
.brand-content h1 {
  font-size: clamp(1.875rem, 3vw, 2.5rem); font-weight: 600;
  line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 1rem; color: #ffffff;
}
.brand-content h1 span { color: var(--rb-gold); }
.brand-content p { font-size: 1.0625rem; line-height: 1.6; color: rgba(255, 255, 255, 0.85); max-width: 480px; }
.brand-features { margin-top: 2.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.brand-feature {
  display: flex; align-items: flex-start; gap: 0.875rem;
  padding: 0.875rem 1rem; background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px;
  backdrop-filter: blur(4px);
}
.brand-feature i {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(201, 162, 39, 0.2); color: var(--rb-gold);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem; flex-shrink: 0;
}
.brand-feature-text strong { display: block; font-weight: 600; color: #ffffff; font-size: 0.9375rem; margin-bottom: 0.15rem; }
.brand-feature-text span { color: rgba(255, 255, 255, 0.75); font-size: 0.8125rem; line-height: 1.4; }
.brand-footer { position: relative; z-index: 1; color: rgba(255, 255, 255, 0.6); font-size: 0.8125rem; }
.brand-footer a { color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.brand-footer a:hover { color: var(--rb-gold); }

/* Right form panel */
.login-form-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2rem; background: #ffffff;
}
.login-card { width: 100%; max-width: 420px; }
.login-card-header { margin-bottom: 2rem; text-align: left; }
.login-card-eyebrow {
  display: inline-block; color: var(--rb-blue); font-size: 0.75rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.login-card-title { font-size: 1.875rem; font-weight: 600; color: var(--rb-navy); letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 0.5rem; }
.login-card-subtitle { color: var(--rb-text-medium); font-size: 0.9375rem; line-height: 1.5; }

.form-group { margin-bottom: 1.125rem; }
.form-label { display: block; font-weight: 500; font-size: 0.875rem; color: var(--rb-text-dark); margin-bottom: 0.5rem; }
.form-input-wrap { position: relative; }
.form-input-wrap i.fld-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--rb-text-light); font-size: 0.95rem; pointer-events: none;
}
.form-input {
  width: 100%; padding: 0.75rem 0.875rem 0.75rem 2.5rem;
  font-family: inherit; font-size: 0.9375rem; color: var(--rb-text-dark);
  background: #ffffff; border: 1px solid var(--rb-border); border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus { outline: none; border-color: var(--rb-blue); box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12); }
.form-input::placeholder { color: var(--rb-text-light); }
.password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  color: var(--rb-text-light); padding: 4px; border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.password-toggle:hover {
  color: var(--rb-blue);
  background: rgba(0, 102, 204, 0.08);
  transform: translateY(-50%) scale(1.1);
}
.password-toggle:active { transform: translateY(-50%) scale(0.95); }

.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; font-size: 0.875rem; }
.remember-me { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; user-select: none; color: var(--rb-text-medium); }
.remember-me input[type=checkbox] { accent-color: var(--rb-blue); width: 16px; height: 16px; cursor: pointer; }
.forgot-link { color: var(--rb-blue); text-decoration: none; font-weight: 500; }
.forgot-link:hover { text-decoration: underline; }

.btn-signin {
  display: block; width: 100%; padding: 0.875rem 1.5rem;
  background: var(--rb-navy); color: #ffffff; border: 1px solid var(--rb-navy);
  border-radius: 8px; font-family: inherit; font-size: 0.9375rem; font-weight: 500;
  cursor: pointer; position: relative; overflow: hidden;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.btn-signin::before {
  content: ''; position: absolute; top: 0; left: -75%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-20deg); transition: left 0.55s ease; pointer-events: none;
}
.btn-signin:hover {
  background: linear-gradient(135deg, var(--rb-navy) 0%, var(--rb-blue) 100%);
  border-color: var(--rb-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 102, 204, 0.28), 0 2px 4px rgba(15, 23, 42, 0.15);
}
.btn-signin:hover::before { left: 120%; }
.btn-signin:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18); }
.btn-signin i { margin-left: 0.5rem; transition: transform 0.25s ease; }
.btn-signin:hover i { transform: translateX(4px); }

.divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0; color: var(--rb-text-light); font-size: 0.8125rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--rb-border); }

.btn-sso {
  display: flex; width: 100%; padding: 0.75rem 1rem; background: #ffffff;
  color: var(--rb-text-dark); border: 1px solid var(--rb-border); border-radius: 8px;
  font-family: inherit; font-size: 0.9375rem; font-weight: 500;
  align-items: center; justify-content: center; gap: 0.625rem; cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}
.btn-sso:hover {
  background: #f8fafc;
  border-color: var(--rb-blue);
  color: var(--rb-navy);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10), 0 0 0 4px rgba(0, 102, 204, 0.08);
}
.btn-sso:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08); }
.btn-sso i { color: var(--rb-blue); transition: transform 0.25s ease; }
.btn-sso:hover i { transform: scale(1.12); }

.signup-row { margin-top: 2rem; text-align: center; font-size: 0.875rem; color: var(--rb-text-medium); }
.signup-row a { color: var(--rb-blue); text-decoration: none; font-weight: 600; }
.signup-row a:hover { text-decoration: underline; }

.form-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rb-border); text-align: center; font-size: 0.75rem; color: var(--rb-text-light); }
.form-footer a { color: var(--rb-text-medium); text-decoration: none; margin: 0 0.5rem; }
.form-footer a:hover { color: var(--rb-blue); }

/* Back to site link */
.back-to-site {
  position: fixed; top: 1.5rem; right: 1.5rem; z-index: 10;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.875rem; background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--rb-border); border-radius: 999px;
  color: var(--rb-text-dark); font-size: 0.8125rem; font-weight: 500;
  text-decoration: none;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.back-to-site:hover {
  color: var(--rb-blue);
  border-color: var(--rb-blue);
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12), 0 0 0 4px rgba(0, 102, 204, 0.08);
  padding-right: 1.125rem;
}
.back-to-site:active { transform: translateY(0); }
.back-to-site i { font-size: 0.75rem; transition: transform 0.25s ease; }
.back-to-site:hover i { transform: translateX(-3px); }

/* Hover effects for inline text links */
.forgot-link, .signup-row a, .form-footer a {
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}
.forgot-link:hover, .signup-row a:hover, .form-footer a:hover {
  color: var(--rb-navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.signup-row a:hover { transform: translateY(-1px); }

/* Alert message (for sign-in attempt feedback) */
.login-alert {
  display: none; padding: 0.75rem 1rem; border-radius: 8px;
  background: rgba(0, 102, 204, 0.08); border: 1px solid rgba(0, 102, 204, 0.25);
  color: var(--rb-text-dark); font-size: 0.8125rem; margin-bottom: 1rem;
}
.login-alert.show { display: flex; align-items: flex-start; gap: 0.5rem; }
.login-alert i { color: var(--rb-blue); margin-top: 2px; flex-shrink: 0; }

/* === Responsive === */
@media (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 2rem 2rem 2.5rem; min-height: auto; }
  .login-brand::before, .login-brand::after { display: none; }
  .brand-content h1 { font-size: 1.625rem; }
  .brand-content p { font-size: 0.9375rem; }
  .brand-chart-preview { margin-top: 1.25rem; max-width: 100%; border-radius: 10px; }
  .brand-chart-caption { font-size: 0.75rem; }
  .brand-features { margin-top: 1.25rem; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .brand-feature { padding: 0.625rem 0.75rem; }
  .brand-feature-text strong { font-size: 0.8125rem; }
  .brand-feature-text span { display: none; }
  .brand-feature i { width: 30px; height: 30px; font-size: 0.85rem; }
  .brand-footer { display: none; }
  .login-form-panel { padding: 2rem 1.25rem; }
  .back-to-site { top: 1rem; right: 1rem; }
}
@media (max-width: 540px) {
  .brand-features { grid-template-columns: 1fr; }
  .login-card-title { font-size: 1.5rem; }
  .brand-logo-mark { width: 44px; height: 44px; }
}
