:root {
  --bg: #0f1115;
  --card: #181b22;
  --text: #f2f4f8;
  --muted: #9aa3b2;
  --accent: #e5484d;
  --primary: #3b82f6;
  --border: #2a2f3a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(env(safe-area-inset-top), 1rem) 1rem max(env(safe-area-inset-bottom), 1rem);
  -webkit-text-size-adjust: 100%;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

h1 { font-size: 1.6rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.4rem; margin: 0.75rem 0 0.25rem; }
.subtitle { color: var(--muted); margin: 0 0 1.75rem; font-size: 0.95rem; }

.view { display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.hidden { display: none !important; }

label {
  align-self: flex-start;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: -0.5rem;
}

input[type="email"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f1115;
  color: var(--text);
}
input[type="email"]:focus { outline: 2px solid var(--primary); border-color: transparent; }

.btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  transition: opacity 0.15s, transform 0.05s;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--primary); }
.btn-stop { background: var(--accent); }

.rec-indicator { color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.countdown {
  font-size: 3.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.check {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #1f8a4c;
  color: #fff;
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
}

.error {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 1rem;
}
