:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #86868b;
  --border: #e8e8ed;
  --accent: #ff375f;
  --accent-text: #ffffff;
  --dark-btn: #1d1d1f;
  --dark-btn-text: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --muted: #8e8e93;
    --border: #2c2c2e;
    --accent: #ff375f;
    --accent-text: #ffffff;
    --dark-btn: #f5f5f7;
    --dark-btn-text: #1d1d1f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 48px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding: 16px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

/* --- hero pulse --- */
.hero {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.pulse-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-wrap .dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 55, 95, 0.5);
  z-index: 2;
}

.pulse-wrap .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: pulse-ring 2.4s ease-out infinite;
}

.pulse-wrap .r1 { animation-delay: 0s; }
.pulse-wrap .r2 { animation-delay: 0.8s; }
.pulse-wrap .r3 { animation-delay: 1.6s; }

@keyframes pulse-ring {
  0%   { transform: scale(0.3); opacity: 0.6; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

.pulse-wrap.firing .dot {
  animation: dot-buzz 0.4s ease-in-out 3;
}

@keyframes dot-buzz {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px) scale(1.1); }
  75% { transform: translateX(3px) scale(1.1); }
}

/* --- text --- */
h1 {
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sub {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 17px;
}

.block {
  padding: 22px 0;
  border-top: 1px solid var(--border);
  text-align: left;
}

.block:first-of-type {
  border-top: none;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.badge {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--border);
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.badge.active {
  background: rgba(52, 199, 89, 0.15);
  color: #2fa84f;
}

.hint {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
}

/* --- buttons --- */
.btn {
  position: relative;
  width: 100%;
  padding: 17px 18px;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.btn-primary {
  background: linear-gradient(180deg, #ff4b6e, var(--accent));
  color: var(--accent-text);
  box-shadow: 0 6px 16px rgba(255, 55, 95, 0.35);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(255, 55, 95, 0.45);
}

.btn-secondary {
  background: var(--dark-btn);
  color: var(--dark-btn-text);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn-secondary .spinner {
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--dark-btn-text);
}

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

.status {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--muted);
  min-height: 18px;
  line-height: 1.4;
  transition: color 0.2s;
}

.status.success {
  color: #2fa84f;
}

.status.error {
  color: var(--accent);
}

/* --- input --- */
.input {
  width: 100%;
  padding: 15px 16px;
  margin-bottom: 12px;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--accent);
}
