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

:root {
  --c-bg: #0e0f14;
  --c-panel: #14161f;
  --c-panel-2: #181a24;
  --c-field: #101117;
  --c-line: rgba(255, 255, 255, 0.08);
  --c-line-strong: rgba(255, 255, 255, 0.16);
  --c-text: #ffffff;
  --c-muted: #cbd5e1;
  --c-muted-2: #94a3b8;
  --c-red: #c0392b;
  --c-red-bright: #e74c3c;
  --c-red-deep: #5c120f;
  --c-red-soft: rgba(231, 76, 60, 0.18);
  --font-display: "Sora", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html, body.auth-page {
  height: 100vh;
  width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background:
    radial-gradient(circle at 18% 18%, rgba(192, 57, 43, 0.25), transparent 45%),
    radial-gradient(circle at 82% 82%, rgba(192, 57, 43, 0.18), transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px), var(--c-bg);
  background-size: auto, auto, 40px 40px, 40px 40px, auto;
  font-family: var(--font-body);
  color: var(--c-text);
  overflow-y: hidden;
}

/* Card Shell */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  min-height: 540px;
  display: grid;
  grid-template-columns: 0.88fr 1fr;
  background: var(--c-panel);
  border: 1px solid var(--c-line-strong);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: cardRise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Brand Panel (Left Side) */
.brand-panel {
  position: relative;
  padding: 38px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(165deg, #221213 0%, #151720 55%, #101117 100%);
  overflow: hidden;
  border-right: 1px solid var(--c-line);
}

.brand-panel .circuit-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.45;
  pointer-events: none;
}

.circuit-bg .trace {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1.2;
}

.circuit-bg .node {
  fill: rgba(255, 255, 255, 0.16);
}

.circuit-bg .trace-live {
  fill: none;
  stroke: var(--c-red-bright);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 6 220;
  filter: drop-shadow(0 0 6px rgba(231, 76, 60, 0.95));
  animation: pulseTrace 4.5s linear infinite;
}

@keyframes pulseTrace {
  0% { stroke-dashoffset: 0; opacity: 0; }
  8% { opacity: 1; }
  85% { opacity: 1; }
  100% { stroke-dashoffset: -640; opacity: 0; }
}

.brand-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-top img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
}

.brand-top span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.brand-mid {
  position: relative;
  z-index: 1;
}

.brand-mid .eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--c-red-bright);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.brand-mid .eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-red-bright);
  box-shadow: 0 0 10px 2px rgba(231, 76, 60, 0.8);
}

.brand-mid h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 30px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.brand-mid p {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--c-muted);
  max-width: 32ch;
}

/* ─── Redesigned Live System Status & Trust Badge Bar ─── */
.brand-bottom-bar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--c-line);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-muted);
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #27ae60;
  box-shadow: 0 0 10px #27ae60;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(39, 174, 96, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

.brand-metric-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--c-muted);
}

.metric-chip i {
  color: var(--c-red-bright);
  font-size: 14px;
}

/* Form Panel */
.form-panel {
  padding: 38px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--c-panel-2);
}

.form-panel .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-muted-2);
  margin-bottom: 8px;
  font-weight: 700;
}

.form-panel .eyebrow b {
  color: var(--c-red-bright);
}

.form-panel h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 27px);
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.form-panel .sub {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--c-muted);
  margin-bottom: 22px;
}

/* Input Fields */
.input-box {
  position: relative;
  margin-bottom: 15px;
}

.input-box label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.input-box .field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-box input {
  width: 100%;
  height: 46px;
  background: var(--c-field) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px;
  outline: none;
  color: #ffffff !important;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 0 46px 0 42px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-box input::placeholder {
  color: var(--c-muted-2) !important;
}

.input-box input:focus {
  border-color: var(--c-red-bright) !important;
  box-shadow: 0 0 0 3px var(--c-red-soft) !important;
}

.input-box .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted-2);
  font-size: 19px;
  pointer-events: none;
}

/* Password Visibility Toggle Icon */
.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer !important;
  pointer-events: auto !important;
  color: #94a3b8 !important;
  font-size: 20px !important;
  z-index: 20 !important;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.toggle-password:hover {
  color: #ffffff !important;
  transform: translateY(-50%) scale(1.1);
}

/* Privacy Agreement Box */
.privacy-agreement-box {
  margin: 14px 0 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  display: block;
}

.privacy-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.privacy-checkbox-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-checkbox-box {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: #101117;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.privacy-checkbox-label input:checked ~ .custom-checkbox-box {
  background: var(--c-red);
  border-color: var(--c-red-bright);
}

.privacy-checkbox-label input:checked ~ .custom-checkbox-box::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.privacy-label-text {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

.privacy-label-text a {
  color: #ff6b6b;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* Data Privacy Modal Overlay */
.privacy-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 16px;
}

.privacy-modal-box {
  background: #181a24;
  border: 1px solid var(--c-line-strong);
  border-radius: 14px;
  width: 580px;
  max-width: 95vw;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7);
  animation: cardRise 0.25s ease;
  overflow: hidden;
}

.privacy-modal-header {
  background: var(--c-red);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.privacy-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.privacy-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.privacy-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  font-size: 13.5px;
  color: #d1d5db;
  line-height: 1.6;
}

.privacy-meta-tag {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 14px;
  font-family: var(--font-mono);
}

.privacy-modal-body h4 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 14px 0 6px;
}

.privacy-modal-body ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.privacy-modal-body li {
  margin-bottom: 4px;
}

.privacy-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--c-line);
  display: flex;
  justify-content: flex-end;
  background: #14161f;
  flex-shrink: 0;
}

.btn-privacy-agree {
  background: var(--c-red);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-privacy-agree:hover {
  background: #a93226;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--c-red) 0%, #a93226 100%);
  box-shadow: 0 8px 22px -6px rgba(192, 57, 43, 0.6);
  transition: transform 0.15s ease, filter 0.15s ease;
  margin-top: 4px;
}

.btn-submit:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.form-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--c-muted);
}

.form-footer a {
  color: var(--c-red-bright);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 860px) {
  html, body.auth-page {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    padding: 24px 16px !important;
  }

  .auth-card {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: auto;
  }

  .brand-panel {
    padding: 24px 20px;
    border-right: none;
    border-bottom: 1px solid var(--c-line);
  }

  .brand-mid p,
  .brand-bottom-bar {
    display: none !important;
  }

  .form-panel {
    padding: 26px 20px;
  }
}

@media (max-width: 480px) {
  html, body.auth-page {
    padding: 16px 10px !important;
  }

  .auth-card {
    border-radius: 14px;
  }

  .brand-panel {
    padding: 20px 16px;
  }

  .form-panel {
    padding: 20px 16px;
  }
}