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

:root {
  --bg: #0d0d0f;
  --surface: #18181c;
  --surface2: #222228;
  --border: #2e2e38;
  --accent: #ff3b3b;
  --accent-hover: #ff5c5c;
  --text: #f0f0f5;
  --muted: #8888a0;
  --success: #22c55e;
  --radius: 12px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  width: 100%;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero .badge {
  display: inline-block;
  background: rgba(255, 59, 59, 0.15);
  color: var(--accent);
  border: 1px solid rgba(255, 59, 59, 0.3);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 40%, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
}

/* ── Recorder ────────────────────────────────────────────────── */
.recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.record-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: rgba(255, 59, 59, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  position: relative;
}

.record-btn:hover { background: rgba(255, 59, 59, 0.2); transform: scale(1.05); }
.record-btn:active { transform: scale(0.97); }

.record-btn .dot {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  transition: border-radius 0.2s;
}

.record-btn.recording .dot {
  border-radius: 4px;
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.75; }
}

.record-btn.recording {
  border-color: var(--accent);
  animation: pulse-ring 1.5s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255, 59, 59, 0); }
}

.recorder-status {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

/* ── Timer & Progress ────────────────────────────────────────── */
.timer {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  display: none;
}

.timer.visible { display: block; }

.progress-wrap {
  width: 100%;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  display: none;
}

.progress-wrap.visible { display: block; }

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 1s linear;
}

/* ── Audio preview ────────────────────────────────────────────── */
.audio-preview {
  width: 100%;
  display: none;
}

.audio-preview.visible { display: block; }

.audio-preview audio {
  width: 100%;
  border-radius: 8px;
  outline: none;
}

.re-record-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  margin-top: 0.5rem;
}

.re-record-btn:hover { border-color: var(--text); color: var(--text); }

/* ── Form ────────────────────────────────────────────────────── */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

input[type="text"],
input[type="email"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9375rem;
  padding: 0.6rem 0.875rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

input:focus { border-color: var(--accent); }
input::placeholder { color: var(--muted); opacity: 0.6; }
input.error { border-color: #f87171; }

.field-error {
  font-size: 0.75rem;
  color: #f87171;
  display: none;
}

.field-error.visible { display: block; }

/* ── Requirements checklist ──────────────────────────────────── */
.req-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.req-list li {
  font-size: 0.8rem;
  color: var(--muted);
  padding-left: 1.4rem;
  position: relative;
}

.req-list li::before {
  content: "○";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.req-list li.done {
  color: var(--success);
}

.req-list li.done::before {
  content: "✓";
  color: var(--success);
}

/* ── Submit button ───────────────────────────────────────────── */
.submit-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  margin-top: 1rem;
}

.submit-btn:hover:not(:disabled) { background: var(--accent-hover); }
.submit-btn:active:not(:disabled) { transform: scale(0.99); }
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Loading spinner ─────────────────────────────────────────── */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.spinner.visible { display: block; }

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

/* ── Status messages ─────────────────────────────────────────── */
.status-msg {
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  display: none;
  margin-top: 1rem;
}

.status-msg.visible { display: block; }
.status-msg.error { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); color: #fca5a5; }
.status-msg.info { background: rgba(99, 179, 237, 0.1); border: 1px solid rgba(99, 179, 237, 0.3); color: #90cdf4; }

/* ── Success screen ──────────────────────────────────────────── */
.success-screen {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
}

.success-screen.visible { display: block; }

.success-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.success-screen h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.success-screen p {
  color: var(--muted);
  line-height: 1.6;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: auto;
}
