:root {
  font-family: "Instrument Sans", system-ui, sans-serif;
  --bg0: #08090d;
  --bg1: #0e1118;
  --surface: rgba(22, 26, 38, 0.85);
  --surface-edge: rgba(255, 255, 255, 0.06);
  --text: #f2f4f8;
  --text-dim: #8f96ab;
  --accent: #7c5cff;
  --accent2: #3d9cf0;
  --danger: #ff5c77;
  --ok: #3ee0a8;
  --radius: 16px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.45;
  background: var(--bg0);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 900px 520px at 15% -8%, rgba(124, 92, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 700px 480px at 95% 15%, rgba(61, 156, 240, 0.12), transparent 50%),
    radial-gradient(ellipse 600px 400px at 50% 100%, rgba(62, 224, 168, 0.06), transparent 45%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg0) 100%);
}

.wrap {
  max-width: 400px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 4rem) 1.25rem 3rem;
}

.hero {
  margin-bottom: 1.5rem;
}

.hero__title {
  margin: 0;
  font-size: clamp(1.65rem, 5vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.card {
  position: relative;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-edge);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 24px 48px -12px rgba(0, 0, 0, 0.55),
    0 0 80px -20px rgba(124, 92, 255, 0.15);
  backdrop-filter: blur(20px);
}

.field {
  margin-bottom: 1.05rem;
}

.field__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.field__wrap {
  position: relative;
}

.field__input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 14, 0.55);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field__input--with-toggle {
  padding-right: 2.65rem;
}

.field__input::placeholder {
  color: rgba(143, 150, 171, 0.45);
}

.field__input:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.field__input:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
  background: rgba(8, 10, 14, 0.75);
}

.field__toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.field__toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.field__toggle:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.6);
  outline-offset: 1px;
}

.field__toggle .icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.actions__row {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
}

.btn--grow {
  flex: 1;
  width: auto;
  min-width: 0;
}

.btn--danger-outline {
  color: var(--danger);
  border-color: rgba(255, 92, 119, 0.35);
}

.btn--danger-outline:hover {
  color: #ff7a8c;
  border-color: rgba(255, 92, 119, 0.55);
  background: rgba(255, 92, 119, 0.08);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.82rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  box-shadow: 0 4px 20px -4px rgba(124, 92, 255, 0.55);
}

.btn--primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 28px -4px rgba(124, 92, 255, 0.6);
}

.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.status {
  margin: 1rem 0 0;
  min-height: 1.35em;
  font-size: 0.875rem;
  font-weight: 500;
}

.status.ok {
  color: var(--ok);
}

.status.err {
  color: var(--danger);
}

.panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(8, 10, 14, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.panel pre {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  overflow: auto;
  color: #a8afc2;
  font-family: ui-monospace, "SF Mono", monospace;
}

.panel .status {
  margin: 0;
}

.hidden {
  display: none !important;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 8, 0.6);
  backdrop-filter: blur(4px);
}

.loader__ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

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