@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Fira+Sans:wght@400;500;600;700&display=swap");

:root {
  --page-bg: #f8fafc;
  --panel-bg: rgba(255, 255, 255, 0.82);
  --panel-border: rgba(148, 163, 184, 0.24);
  --panel-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
  --text-main: #0f172a;
  --text-soft: #475569;
  --blue-strong: #1e40af;
  --blue-soft: #3b82f6;
  --amber-strong: #d97706;
  --input-bg: rgba(255, 255, 255, 0.88);
  --progress-bg: #dbeafe;
  --progress-fill: linear-gradient(90deg, #1e40af 0%, #60a5fa 100%);
}

html {
  min-height: 100%;
}

body {
  font-family: "Fira Sans", "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--page-bg);
  letter-spacing: -0.01em;
  scroll-behavior: smooth;
}

.app-shell {
  position: relative;
  overflow-x: hidden;
}

.app-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.app-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(40px);
  opacity: 0.7;
}

.app-orb-a {
  width: 28rem;
  height: 28rem;
  top: -8rem;
  left: -6rem;
  background: rgba(59, 130, 246, 0.22);
}

.app-orb-b {
  width: 24rem;
  height: 24rem;
  right: -6rem;
  top: 12rem;
  background: rgba(245, 158, 11, 0.16);
}

.app-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(15, 23, 42, 0.6), transparent 80%);
}

.panel,
.hero-panel,
.hero-side-panel,
.stat-card,
.metric-tile,
.empty-state {
  position: relative;
  z-index: 1;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero-panel {
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.15), transparent 30%),
    rgba(255, 255, 255, 0.76);
}

.hero-side-panel,
.metric-tile {
  background: rgba(255, 255, 255, 0.72);
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(191, 219, 254, 0.9);
  padding: 0.65rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue-strong);
}

.input-surface {
  background: var(--input-bg);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.input-surface:focus {
  border-color: rgba(59, 130, 246, 0.65) !important;
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.12),
    0 14px 28px rgba(30, 64, 175, 0.08);
  transform: translateY(-1px);
}

.input-surface:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.settings-panel {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.72);
  padding: 1.1rem;
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-status {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.6;
  text-align: right;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(170px, 0.75fr) minmax(260px, 2fr) minmax(110px, 0.45fr) auto;
  gap: 0.9rem;
  align-items: end;
}

.settings-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.settings-field span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-input {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.88);
  padding: 0 0.9rem;
  color: var(--text-main);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.settings-input:focus {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  cursor: pointer;
  user-select: none;
}

.toggle-track {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: #e2e8f0;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: white;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
  transition: transform 180ms ease;
}

.toggle-field input:checked + .toggle-track {
  border-color: rgba(37, 99, 235, 0.7);
  background: #2563eb;
}

.toggle-field input:checked + .toggle-track .toggle-thumb {
  transform: translateX(22px);
}

.toggle-text {
  color: var(--text-main);
  font-size: 0.94rem;
  font-weight: 700;
}

.settings-save {
  min-width: 110px;
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
}

textarea,
.mono-font {
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  border-radius: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  box-shadow: 0 18px 30px rgba(59, 130, 246, 0.28);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(30, 64, 175, 0.25);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.secondary-button:hover {
  transform: translateY(-1px);
  background: white;
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.primary-button.is-loading {
  opacity: 0.92;
}

.status-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-radius: 20px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  background: rgba(239, 246, 255, 0.8);
  padding: 0.9rem 1rem;
}

.status-text {
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 0.95rem;
}

.progress-track {
  height: 12px;
  border-radius: 9999px;
  background: var(--progress-bg);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--progress-fill);
  transition: width 220ms ease;
}

.stat-card {
  border-radius: 24px;
  padding: 1.25rem;
  min-height: 144px;
}

.stat-label,
.metric-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #64748b;
}

.stat-value,
.metric-value {
  display: block;
  margin-top: 0.8rem;
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1;
  font-weight: 700;
  color: var(--text-main);
}

.stat-note {
  margin-top: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 0.92rem;
}

.metric-tile {
  border-radius: 20px;
  padding: 1rem;
}

.metric-value {
  font-size: 1.15rem;
  margin-top: 0.4rem;
}

.empty-state {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-radius: 24px;
  padding: 1.4rem;
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1.2rem;
  background: rgba(219, 234, 254, 0.95);
  color: var(--blue-strong);
}

.results-table-wrap {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.results-table {
  border-spacing: 0;
  width: 100%;
}

.results-table th {
  padding: 1rem 0 1rem 1rem;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: #64748b;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.88);
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 28px;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
}

.sort-button:hover {
  color: var(--blue-strong);
}

.sort-button.is-active {
  color: var(--blue-strong);
}

.sort-indicator {
  display: inline-flex;
  justify-content: center;
  width: 1em;
  color: var(--blue-strong);
}

.results-table td {
  padding: 1rem 0 1rem 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
}

.language-column {
  width: 96px;
}

.status-column {
  width: 100px;
}

.login-shell {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.login-visual {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.38), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(34, 211, 238, 0.22), transparent 26%),
    linear-gradient(180deg, rgba(10, 23, 54, 0.98) 0%, rgba(9, 17, 34, 0.98) 100%);
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(15, 23, 42, 0.8), transparent 88%);
  pointer-events: none;
}

.login-data-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.login-data-card {
  position: relative;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.08);
  padding: 1.1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-data-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.78);
}

.login-data-value {
  display: block;
  margin-top: 0.7rem;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
  color: white;
}

.login-data-note {
  margin-top: 0.8rem;
  font-size: 0.92rem;
  line-height: 1.7;
  color: rgba(219, 234, 254, 0.72);
}

.login-signal-panel {
  border-radius: 26px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  background: rgba(8, 47, 73, 0.28);
  padding: 1.1rem 1.2rem 1.3rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.signal-header {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(165, 243, 252, 0.92);
}

.signal-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: #22d3ee;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.8);
}

.signal-lines {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.signal-lines span {
  display: block;
  height: 10px;
  border-radius: 9999px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.85), rgba(59, 130, 246, 0.12));
}

.signal-lines span:nth-child(2) {
  width: 86%;
}

.signal-lines span:nth-child(3) {
  width: 70%;
}

.signal-lines span:nth-child(4) {
  width: 58%;
}

.login-form-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.92));
}

.login-form-panel {
  padding: 0.75rem 0;
}

.login-form-motion {
  position: relative;
  height: 120px;
  border-radius: 28px;
  border: 1px solid rgba(191, 219, 254, 0.8);
  background:
    radial-gradient(circle at center, rgba(59, 130, 246, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.98));
  overflow: hidden;
}

.motion-ring,
.motion-core,
.motion-line {
  position: absolute;
}

.motion-ring {
  inset: 50%;
  border-radius: 9999px;
  transform: translate(-50%, -50%);
}

.motion-ring-a {
  width: 84px;
  height: 84px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  animation: ringPulseA 3.6s ease-in-out infinite;
}

.motion-ring-b {
  width: 120px;
  height: 120px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  animation: ringPulseB 4.2s ease-in-out infinite;
}

.motion-core {
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1e40af, #22d3ee);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.32);
  animation: corePulse 2.8s ease-in-out infinite;
}

.motion-line {
  left: 50%;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.55), transparent);
  transform: translateX(-50%);
}

.motion-line-a {
  top: 30px;
  width: 58%;
  animation: lineDrift 3.8s ease-in-out infinite;
}

.motion-line-b {
  bottom: 34px;
  width: 42%;
  animation: lineDrift 4.8s ease-in-out infinite reverse;
}

.motion-line-c {
  top: 50%;
  width: 72%;
  opacity: 0.9;
  animation: lineGlow 2.9s ease-in-out infinite;
}

.result-row {
  transition: background-color 180ms ease, transform 180ms ease;
}

.result-row:hover {
  background: rgba(239, 246, 255, 0.68);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.status-chip-traffic {
  background: rgba(219, 234, 254, 1);
  color: #1d4ed8;
}

.status-chip-zero {
  background: rgba(241, 245, 249, 1);
  color: #64748b;
}

.status-chip-pending {
  background: rgba(226, 232, 240, 0.8);
  color: #475569;
}

.status-chip-error {
  background: rgba(254, 243, 199, 0.9);
  color: var(--amber-strong);
}

.overflow-x-auto {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ringPulseA {
  0%,
  100% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(0.96);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

@keyframes ringPulseB {
  0%,
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(0.94);
  }
  50% {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(1.03);
  }
}

@keyframes corePulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.92);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.24);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 0 34px rgba(59, 130, 246, 0.38);
  }
}

@keyframes lineDrift {
  0%,
  100% {
    opacity: 0.35;
    transform: translateX(-50%) scaleX(0.95);
  }
  50% {
    opacity: 0.9;
    transform: translateX(-50%) scaleX(1.03);
  }
}

@keyframes lineGlow {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.animate-spin {
  animation: spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1024px) {
  .hero-panel {
    padding: 1.5rem;
  }

  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }

  .settings-field-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .status-wrap,
  .empty-state {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-data-grid {
    grid-template-columns: 1fr;
  }

  .settings-header {
    flex-direction: column;
  }

  .settings-status {
    text-align: left;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-save {
    width: 100%;
  }

  .settings-actions {
    flex-direction: column;
  }

  .col-optional {
    display: none;
  }

  .language-column {
    width: 76px;
  }

  .status-column {
    width: 84px;
  }

  .results-table th,
  .results-table td {
    padding-left: 0.8rem;
  }
}
