/* ================================================================
   Externalsight — Sign In  (Operator Console, v20260510)
   Design tokens mirror Landing Page B / Dashboard B vocabulary
   ================================================================ */

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
a { color: inherit; text-decoration: none; }

body {
  font-family: 'Geist', -apple-system, system-ui, sans-serif;
  background: #07090C;
  color: #E8ECF2;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

button { font-family: inherit; }

input::placeholder { color: #48505F; }

::selection { background: rgba(94,233,240,0.27); color: #fff; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #07090C; }
::-webkit-scrollbar-thumb { background: #1C2330; border-radius: 4px; border: 2px solid #07090C; }
::-webkit-scrollbar-thumb:hover { background: #2A3344; }

/* ── Fonts ───────────────────────────────────────────────────── */
.mono { font-family: 'Geist Mono', ui-monospace, monospace; }
.serif { font-family: 'Instrument Serif', Georgia, serif; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes scanSweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes sgPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes sgBlink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@keyframes sgFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Layout ──────────────────────────────────────────────────── */
.sg-auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(500px, 0.9fr);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Background radial glow */
.sg-auth-split::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 25% 30%, rgba(94,233,240,0.055), transparent 70%),
    radial-gradient(ellipse 40% 40% at 90% 80%, rgba(167,139,250,0.063), transparent 70%);
  z-index: 0;
}

/* ── LEFT POSTER PANEL ───────────────────────────────────────── */
.sg-auth-brand {
  position: relative;
  padding: 40px 56px;
  border-right: 1px solid rgba(255,255,255,0.055);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  background: linear-gradient(180deg, transparent 0%, #05070A 100%);
  z-index: 1;
}

/* Grid decoration */
.sg-auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 30% 40%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 30% 40%, black 30%, transparent 75%);
}

/* ── Logo ──────────────────────────────────────────────────── */
.sg-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  position: relative;
}
.sg-brand-logo svg { flex-shrink: 0; }
.sg-brand-logo span {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  color: #E8ECF2;
}

/* ── Poster top section ──────────────────────────────────────── */
.sg-brand-top { position: relative; }

.sg-brand-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: #5EE9F0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 56px;
}

.sg-brand-headline {
  font-size: clamp(32px, 3.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 22px 0 0;
  color: #E8ECF2;
  max-width: 520px;
}
.sg-brand-headline em {
  font-style: italic;
  font-weight: 400;
  color: #5EE9F0;
  font-family: 'Instrument Serif', Georgia, serif;
}

.sg-brand-desc {
  font-size: 15.5px;
  line-height: 1.55;
  color: #6B7689;
  margin: 22px 0 0;
  max-width: 440px;
}

/* ── Telemetry mid-section ───────────────────────────────────── */
.sg-brand-telemetry {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 40px 0;
}

/* ── Radar ───────────────────────────────────────────────────── */
.sg-radar-wrap {
  width: 210px;
  height: 210px;
  flex-shrink: 0;
  position: relative;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 50%;
  background: radial-gradient(circle at center, #10141B 0%, #07090C 70%);
}

.sg-radar-static { position: absolute; inset: 0; }

.sg-radar-sweep {
  position: absolute;
  inset: 0;
  animation: scanSweep 4s linear infinite;
  transform-origin: 50% 50%;
}

.sg-radar-label {
  position: absolute;
  bottom: -26px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: #5EE9F0;
  letter-spacing: 0.16em;
  font-weight: 600;
}

/* ── Live event feed ─────────────────────────────────────────── */
.sg-event-feed {
  flex: 1;
  background: #10141B;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 8px;
  overflow: hidden;
}

.sg-event-feed-head {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sg-event-feed-title {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: #6B7689;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}

.sg-event-feed-status {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: #5EE9F0;
  animation: sgPulse 2s ease-in-out infinite;
}

.sg-event-feed-body {
  padding: 6px 14px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  line-height: 2;
}

.sg-event-row {
  display: flex;
  gap: 10px;
}

.sg-event-time { color: #48505F; flex-shrink: 0; }
.sg-event-level { flex-shrink: 0; width: 40px; }
.sg-event-msg { color: #B6BFCE; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-event-target { color: #48505F; flex-shrink: 0; }

.sg-event-row:nth-child(1) { opacity: 1; }
.sg-event-row:nth-child(2) { opacity: 0.85; }
.sg-event-row:nth-child(3) { opacity: 0.7; }
.sg-event-row:nth-child(4) { opacity: 0.55; }
.sg-event-row:nth-child(5) { opacity: 0.4; }

/* ── Stats grid ─────────────────────────────────────────────── */
.sg-brand-bottom { position: relative; }

.sg-stats-grid {
  display: flex;
  gap: 0;
  align-items: stretch;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 8px;
  background: #10141B;
  overflow: hidden;
}

.sg-stat-cell {
  flex: 1;
  padding: 15px 17px;
  border-right: 1px solid rgba(255,255,255,0.055);
}
.sg-stat-cell:last-child { border-right: none; }

.sg-stat-label {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  color: #6B7689;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.sg-stat-value {
  font-family: 'Geist Mono', monospace;
  font-size: 21px;
  font-weight: 600;
  color: #E8ECF2;
  margin-top: 7px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.sg-stat-sub {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  color: #48505F;
  margin-top: 2px;
}

/* ── Trust badges ───────────────────────────────────────────── */
.sg-trust-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.sg-trust-badges { display: flex; gap: 8px; align-items: center; }

.sg-trust-badge {
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 5px;
  background: #0B0E13;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.sg-trust-badge-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: #B6BFCE;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.sg-trust-badge-sub {
  font-family: 'Geist Mono', monospace;
  font-size: 9px;
  color: #6B7689;
}

.sg-copyright {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: #48505F;
  letter-spacing: 0.08em;
}

/* ── RIGHT FORM PANEL ────────────────────────────────────────── */
.sg-auth-form-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  min-height: 100vh;
  z-index: 1;
}

/* ── Back button ─────────────────────────────────────────────── */
.sg-back-btn {
  position: absolute;
  top: 32px;
  left: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  color: #48505F;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 0.15s;
  z-index: 2;
}
.sg-back-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.sg-back-btn:hover {
  color: #B6BFCE;
}
.sg-back-btn:hover svg {
  transform: translateX(-3px);
}

/* Operational status pill */
.sg-status-pill {
  position: absolute;
  top: 32px;
  right: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  color: #4ADE80;
  padding: 4px 9px;
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 99px;
  background: rgba(74,222,128,0.063);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.sg-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 6px #4ADE80;
}

/* ── Form container ─────────────────────────────────────────── */
.sg-auth-container {
  width: 100%;
  max-width: 420px;
  animation: sgFadeIn 0.3s ease both;
}

/* ── Eyebrow ──────────────────────────────────────────────────── */
.sg-form-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: #5EE9F0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ── Heading ──────────────────────────────────────────────────── */
.sg-auth-title {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 11px 0 0;
  color: #E8ECF2;
  line-height: 1.1;
}
.sg-auth-title em {
  font-style: italic;
  font-weight: 400;
  color: #5EE9F0;
  font-family: 'Instrument Serif', Georgia, serif;
}

.sg-auth-subtitle {
  font-size: 13px;
  color: #6B7689;
  margin: 9px 0 0;
  line-height: 1.5;
}

/* ── SSO buttons ────────────────────────────────────────────── */
.sg-sso-group {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sg-sso-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #0B0E13;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 6px;
  color: #E8ECF2;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.13s, border-color 0.13s;
  text-decoration: none;
}
.sg-sso-btn:hover {
  background: #10141B;
  border-color: rgba(255,255,255,0.122);
}

.sg-sso-btn svg { flex-shrink: 0; }
.sg-sso-btn span { flex: 1; }

.sg-sso-arrow { color: #48505F; }

/* ── Divider ─────────────────────────────────────────────────── */
.sg-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
}
.sg-auth-divider::before,
.sg-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.055);
}
.sg-auth-divider span {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: #6B7689;
  letter-spacing: 0.16em;
}

/* ── Form ────────────────────────────────────────────────────── */
.sg-auth-form { display: flex; flex-direction: column; gap: 14px; }

.sg-auth-form-group { display: flex; flex-direction: column; }

.sg-auth-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: #6B7689;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 7px;
}

.sg-auth-input-wrap { position: relative; }

.sg-auth-input {
  width: 100%;
  padding: 11px 14px;
  background: #0B0E13;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 6px;
  color: #E8ECF2;
  font-size: 14px;
  font-family: 'Geist Mono', monospace;
  outline: none;
  transition: border-color 0.13s, box-shadow 0.13s;
}
.sg-auth-input:focus {
  border-color: rgba(94,233,240,0.53);
  box-shadow: 0 0 0 3px rgba(94,233,240,0.1);
}
.sg-auth-input.has-error {
  border-color: rgba(251,113,133,0.6);
}

.sg-auth-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #48505F;
  pointer-events: none;
}

.sg-auth-input.with-icon { padding-left: 38px; }

/* password row header */
.sg-pw-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}

.sg-auth-forgot {
  font-size: 11.5px;
  color: #B6BFCE;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.122);
  line-height: 1;
}
.sg-auth-forgot:hover { color: #E8ECF2; }

.sg-auth-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6B7689;
  padding: 5px;
  display: flex;
  align-items: center;
}
.sg-auth-password-toggle:hover { color: #B6BFCE; }

/* ── Remember me ─────────────────────────────────────────────── */
.sg-remember-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  margin-top: 2px;
}

.sg-remember-box {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  border: 1.5px solid rgba(255,255,255,0.122);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.13s;
  cursor: pointer;
}
.sg-remember-box.checked {
  border-color: #5EE9F0;
  background: #5EE9F0;
}

.sg-remember-text { font-size: 12.5px; color: #B6BFCE; }

/* ── Submit button ───────────────────────────────────────────── */
.sg-auth-btn-primary {
  margin-top: 6px;
  padding: 13px 18px;
  background: #5EE9F0;
  color: #03252A;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.13s, transform 0.1s;
  position: relative;
  overflow: hidden;
}
.sg-auth-btn-primary:hover { opacity: 0.9; }
.sg-auth-btn-primary:active { transform: scale(0.99); }
.sg-auth-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loader inside button */
.sg-auth-loader {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(3,37,42,0.3);
  border-top-color: #03252A;
  border-radius: 50%;
  animation: scanSweep 0.6s linear infinite;
}

/* ── Magic link ──────────────────────────────────────────────── */
.sg-magic-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.sg-magic-or { font-size: 11.5px; color: #6B7689; }
.sg-magic-link {
  font-size: 11.5px;
  color: #B6BFCE;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,0.122);
}
.sg-magic-link:hover { color: #E8ECF2; }

/* ── Error / feedback ────────────────────────────────────────── */
.sg-auth-error {
  font-size: 11.5px;
  color: #FB7185;
  margin-top: 5px;
  display: none;
}

.sg-auth-feedback {
  display: none;
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 12px;
  animation: sgFadeIn 0.2s ease;
}
.sg-auth-feedback.error {
  display: block;
  background: rgba(251,113,133,0.1);
  border: 1px solid rgba(251,113,133,0.25);
  color: #FB7185;
}
.sg-auth-feedback.success {
  display: block;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.22);
  color: #4ADE80;
}

/* ── Form footer ─────────────────────────────────────────────── */
.sg-form-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.055);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sg-form-switch {
  font-size: 12px;
  color: #6B7689;
}
.sg-form-switch a {
  color: #E8ECF2;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.122);
}
.sg-form-switch a:hover { color: #5EE9F0; }

.sg-form-links { display: flex; gap: 14px; }
.sg-form-links a {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: #6B7689;
  text-decoration: none;
  letter-spacing: 0.06em;
}
.sg-form-links a:hover { color: #B6BFCE; }

/* ── Password strength meter (register page) ─────────────────── */
.sg-password-strength {
  margin-top: 10px;
}

.sg-strength-bar {
  height: 3px;
  background: rgba(255,255,255,0.055);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.sg-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.25s ease, background 0.25s ease;
}

.sg-strength-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sg-strength-checks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.sg-strength-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: #48505F;
  transition: color 0.15s;
}

.sg-strength-check svg {
  width: 10px;
  height: 10px;
  stroke: #48505F;
  flex-shrink: 0;
  transition: stroke 0.15s;
}

.sg-strength-check.met { color: #4ADE80; }
.sg-strength-check.met svg { stroke: #4ADE80; }

/* ── Terms hint (register page) ─────────────────────────────── */
.sg-auth-hint {
  font-size: 11.5px;
  color: #48505F;
  line-height: 1.6;
  margin-top: 6px;
  text-align: center;
}
.sg-auth-hint a,
.sg-auth-hint a:link,
.sg-auth-hint a:visited {
  color: #6B7689;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  transition: color 0.13s, border-color 0.13s;
}
.sg-auth-hint a:hover {
  color: #B6BFCE;
  border-bottom-color: rgba(255,255,255,0.3);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sg-auth-split {
    grid-template-columns: 1fr;
  }
  .sg-auth-brand {
    display: none;
  }
  .sg-auth-form-panel {
    min-height: 100vh;
    align-items: flex-start;
    padding-top: 72px;
  }
  .sg-back-btn {
    top: 20px;
    left: 20px;
  }
  .sg-status-pill {
    top: 20px;
    right: 20px;
  }
}
