:root {
  color-scheme: dark;
  --bg: #060a11;
  --elev: #0b111c;
  --panel: #101927;
  --panel-2: #152238;
  --text: #dce4ee;
  --muted: #8f9bac;
  --blue: #168cff;
  --cyan: #2bc7ff;
  --deep: #063c8c;
  --glow: rgba(22, 140, 255, 0.24);
  --border: rgba(110, 150, 195, 0.18);
  --success: #39d6a0;
  --warning: #f3b84b;
  --critical: #ff6577;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -15%, rgba(22, 140, 255, 0.16), transparent
    38%),
    linear-gradient(180deg, #07101b 0%, var(--bg) 48%, #05080e 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.particle-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    radial-gradient(circle, rgba(43, 199, 255, 0.8) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(22, 140, 255, 0.5) 0 1px, transparent 1.5px);
  background-size: 58px 58px, 91px 91px;
  background-position: 12px 8px, 38px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
  animation: atlas-particles 24s linear infinite;
}

.ambient-core {
  position: fixed;
  z-index: 1;
  left: 50vw;
  top: 50vh;
  top: 50dvh;
  width: min(88vw, 410px);
  height: min(88vw, 410px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.3;
  filter: drop-shadow(0 0 36px rgba(22, 140, 255, 0.2));
}

.core-orbit {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.core-orbit::before,
.core-orbit::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(43, 199, 255, 0.12);
  border-radius: 50%;
  animation: atlas-scan 9s ease-in-out infinite;
}

.core-orbit::after {
  inset: 21%;
  animation-delay: -4.5s;
}

.core-orbit img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topbar {
  position: relative;
  z-index: 3;
  width: min(100%, 820px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 22px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.atlas-mark {
  width: 118px;
  height: auto;
  display: block;
}

.secure-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b8c4d2;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.secure-dot,
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 14px rgba(57, 214, 160, 0.72);
}

.shell {
  position: relative;
  z-index: 2;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 22px 18px calc(36px + env(safe-area-inset-bottom));
}

.hero {
  padding: 18px 4px 24px;
}

.eyebrow,
.kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1,
.card h2 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2rem, 10vw, 3.25rem);
  line-height: 1;
}

.lead {
  max-width: 600px;
  margin: 16px 0 0;
  color: #aab6c5;
  line-height: 1.65;
}

.card {
  position: relative;
  overflow: hidden;
  margin: 0 0 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(18, 31, 49, 0.96), rgba(10, 18, 30, 0.94));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(43, 199, 255, 0.42),
    transparent);
}

.section-heading,
.session-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2,
.session-card h2,
.preview-card h2,
.confirmation-card h2 {
  font-size: 1.2rem;
}

.status-pill,
.risk-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(43, 199, 255, 0.24);
  border-radius: 999px;
  padding: 6px 10px;
  color: #a9dcff;
  background: rgba(22, 140, 255, 0.09);
  font-size: 0.7rem;
  font-weight: 700;
}

.status-pill.warning {
  color: #f5cf80;
  border-color: rgba(243, 184, 75, 0.3);
  background: rgba(243, 184, 75, 0.08);
}

.status-pill.success {
  color: #8de8c4;
  border-color: rgba(57, 214, 160, 0.3);
  background: rgba(57, 214, 160, 0.08);
}

form,
label {
  display: grid;
}

form {
  gap: 14px;
}

label {
  gap: 8px;
  color: #b9c5d3;
  font-size: 0.86rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(110, 150, 195, 0.24);
  border-radius: 14px;
  outline: none;
  background: rgba(5, 11, 19, 0.8);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input {
  min-height: 48px;
  padding: 12px 14px;
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: rgba(43, 199, 255, 0.68);
  box-shadow: 0 0 0 4px rgba(22, 140, 255, 0.12);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

button:active {
  transform: translateY(1px) scale(0.995);
}

button:disabled {
  cursor: wait;
  opacity: 0.48;
}

.primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), #0e70e3);
  box-shadow: 0 12px 28px rgba(22, 140, 255, 0.22);
}

.secondary {
  color: #cbe8ff;
  border: 1px solid rgba(43, 199, 255, 0.25);
  background: rgba(22, 140, 255, 0.11);
}

.ghost {
  color: #a9b6c5;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.danger {
  color: #ffd9df;
  border: 1px solid rgba(255, 101, 119, 0.32);
  background: rgba(255, 101, 119, 0.13);
}

.wide {
  width: 100%;
}

.fine-print,
#setup-copy,
#device-summary,
#confirm-summary {
  color: var(--muted);
  line-height: 1.55;
}

.fine-print {
  margin: 14px 0 0;
  font-size: 0.76rem;
}

.session-card {
  align-items: center;
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.session-copy p {
  margin-bottom: 0;
}

.device-id-row {
  display: grid;
  gap: 7px;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.device-id-row code {
  overflow-wrap: anywhere;
  color: #cfeaff;
  font-size: 0.78rem;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-button,
.empty-state {
  width: 100%;
  border: 1px solid rgba(110, 150, 195, 0.15);
  border-radius: 16px;
  background: rgba(7, 14, 24, 0.68);
  padding: 14px;
  color: var(--text);
  text-align: left;
}

.notification-button {
  display: grid;
  gap: 8px;
}

.notification-button:hover {
  border-color: rgba(43, 199, 255, 0.32);
}

.notification-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-title {
  font-weight: 750;
}

.notification-meta,
.empty-state {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.risk-high {
  color: #ffb9c2;
  border-color: rgba(255, 101, 119, 0.32);
  background: rgba(255, 101, 119, 0.1);
}

.risk-medium {
  color: #f6d28b;
  border-color: rgba(243, 184, 75, 0.28);
  background: rgba(243, 184, 75, 0.08);
}

.risk-low {
  color: #8de8c4;
  border-color: rgba(57, 214, 160, 0.26);
  background: rgba(57, 214, 160, 0.08);
}

.preview-grid {
  display: grid;
  grid-template-columns: minmax(108px, 0.36fr) 1fr;
  gap: 10px 14px;
  margin: 0;
}

.preview-grid dt {
  color: var(--muted);
  font-size: 0.77rem;
}

.preview-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #d5e0ec;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.decision-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.confirm-check {
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
}

.confirm-check input {
  width: 20px;
  min-height: 20px;
  margin: 1px 0 0;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 6px 0;
  color: #a8b5c4;
  font-size: 0.78rem;
}

.status-bar.error .status-indicator {
  background: var(--critical);
  box-shadow: 0 0 14px rgba(255, 101, 119, 0.7);
}

.status-bar.warning .status-indicator {
  background: var(--warning);
  box-shadow: 0 0 14px rgba(243, 184, 75, 0.7);
}

[hidden] {
  display: none !important;
}

@keyframes atlas-particles {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-58px, 58px, 0);
  }
}

@keyframes atlas-scan {
  0%,
  100% {
    opacity: 0.16;
    transform: scale(0.94);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.04);
  }
}

@media (max-width: 560px) {
  .topbar {
    padding-inline: 18px;
  }

  .atlas-mark {
    width: 104px;
  }

  .secure-state {
    font-size: 0.7rem;
  }

  .shell {
    padding-inline: 14px;
  }

  .card {
    padding: 18px;
  }

  .session-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-actions {
    width: 100%;
    justify-content: stretch;
  }

  .session-actions button {
    flex: 1;
  }

  .preview-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .preview-grid dd {
    margin-bottom: 10px;
  }
}

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

.text-button {
  width: 100%;
  min-height: 40px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: #8ecfff;
  text-align: center;
  box-shadow: none;
}

.text-button:hover {
  color: #c9eaff;
  background: rgba(22, 140, 255, 0.06);
}

.recovery-card {
  scroll-margin-top: 18px;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  padding-right: 78px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 58px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid rgba(81, 174, 255, 0.32);
  border-radius: 9px;
  background: rgba(13, 31, 53, 0.92);
  color: #9dd7ff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  transform: translateY(-50%);
  box-shadow: none;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: #e1f3ff;
  border-color: rgba(81, 174, 255, 0.7);
  background: rgba(19, 48, 79, 0.98);
}
