/* ─── tokens ─── */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --line-2: #f3f4f6;
  --brand: #2563eb;
  --brand-ink: #1e40af;
  --brand-soft: #eff6ff;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #dc2626;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-2: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-3: 0 10px 40px rgba(0,0,0,0.10);
  --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand); }

/* ─── header ─── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.brand .paw { font-size: 22px; }
.price-pill {
  background: var(--brand-soft);
  color: var(--brand-ink);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
}

/* ─── shell ─── */
.shell {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ─── progress rail ─── */
.progress {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 36px;
  position: relative;
  padding: 0 8px;
}
.progress::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.step-dot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.step-dot span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}
.step-dot label {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.step-dot.active span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.step-dot.active label {
  color: var(--ink);
}
.step-dot.done span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.step-dot.done span::before {
  content: '✓';
}
.step-dot.done span > * { display: none; }

@media (max-width: 540px) {
  .step-dot label { display: none; }
}

/* ─── steps ─── */
.step {
  display: none;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 36px 32px;
  animation: fadeIn 0.25s ease;
}
.step.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }

.lede {
  color: var(--ink-2);
  font-size: 15px;
  margin-bottom: 24px;
}

/* ─── form fields ─── */
.field { display: block; margin-bottom: 18px; }
.lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.lbl .hint {
  font-weight: 400;
  color: var(--ink-3);
}
input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
textarea { resize: vertical; min-height: 110px; }
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; gap: 0; }
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--danger);
}
.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

/* ─── actions ─── */
.actions {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  gap: 12px;
}
.actions .btn-primary { margin-left: auto; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  transition: transform 0.05s, background 0.15s, opacity 0.15s;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-ink); }
.btn-secondary {
  background: var(--line-2);
  color: var(--ink);
}
.btn-secondary:hover { background: var(--line); }
.btn-pay {
  padding: 14px 28px;
  font-size: 16px;
}
.btn-link {
  background: none;
  color: var(--brand);
  padding: 4px 0;
  font-size: 13px;
  text-decoration: underline;
}

/* ─── voice picker ─── */
.voice-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  background: var(--line-2);
  padding: 4px;
  border-radius: var(--radius-md);
  width: fit-content;
}
.voice-tab {
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.voice-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.voices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding: 2px;
}

.voice-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s;
  background: var(--surface);
}
.voice-card:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.voice-card.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}
.voice-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.voice-name { font-weight: 600; font-size: 14px; }
.voice-meta {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.play-btn {
  background: var(--ink);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.play-btn:hover { background: var(--brand); }
.play-btn.playing { background: var(--accent); }
.voice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.voice-tag {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--line-2);
  border-radius: 99px;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ─── photo tips ─── */
.photo-tips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 540px) {
  .photo-tips { grid-template-columns: 1fr; }
}
.tips-col h3 { margin-bottom: 8px; }
.tips-do h3 { color: var(--success); }
.tips-dont h3 { color: var(--danger); }
.tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.tips-grid figure {
  text-align: center;
}
.tips-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.tips-grid figcaption {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 4px;
}

/* ─── dropzone ─── */
.dropzone {
  display: block;
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: all 0.15s;
  margin-bottom: 8px;
  position: relative;
}
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.dragging { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dz-icon { font-size: 32px; margin-bottom: 8px; }
.dz-headline { font-weight: 600; margin-bottom: 4px; }
.dz-sub { font-size: 13px; color: var(--ink-3); }
#dz-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
#preview-img {
  max-width: 240px;
  max-height: 240px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

/* ─── review ─── */
.review {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 18px;
}
.review-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.review-row:last-of-type { border-bottom: none; }
.review-row span:first-child { color: var(--ink-3); font-weight: 500; }
.review-row span:last-child { font-weight: 600; max-width: 60%; text-align: right; }
.review-msg span:last-child {
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
}
.review-photo {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.review-photo img {
  max-width: 140px;
  max-height: 140px;
  border-radius: var(--radius-md);
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-1);
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-top: 2px solid var(--ink);
  margin-bottom: 14px;
}
.total-label { font-weight: 700; font-size: 17px; }
.total-amount { font-weight: 700; font-size: 22px; }

.fine-print {
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  margin-bottom: 10px;
}

/* ─── error banner ─── */
.error-banner {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  margin-top: 16px;
}

/* ─── upload spinner overlay ─── */
.uploading {
  position: relative;
  pointer-events: none;
}
.uploading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
  border-radius: var(--radius-md);
  z-index: 5;
}
.uploading::before {
  content: '⏳ Uploading photo…';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 6;
  font-weight: 600;
  color: var(--ink);
}

/* ─── footer ─── */
.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
