:root {
  --bg: #f6f3ee;
  --bg-2: #ece7df;
  --ink: #1c1917;
  --muted: #6b645c;
  --line: rgba(28, 25, 23, 0.1);
  --card: #fffdf9;
  --primary: #5b21b6;
  --primary-2: #4c1d95;
  --primary-soft: #ede9fe;
  --primary-text: #5b21b6;
  --ok: #047857;
  --ok-soft: #d1fae5;
  --danger: #be123c;
  --danger-soft: #ffe4e6;
  --shadow: 0 10px 30px rgba(28, 25, 23, 0.08);
  --radius: 20px;
  --tap: 52px;
  --sticky: 118px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 100% -10%, #ddd6fe 0%, transparent 55%),
    radial-gradient(700px 380px at -10% 0%, #fde68a 0%, transparent 42%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(48px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
}

.app.has-sticky {
  padding-bottom: calc(var(--sticky) + env(safe-area-inset-bottom));
}

.topbar {
  position: relative;
  display: block;
  text-align: center;
  margin-bottom: 28px;
  padding: 0 72px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.topbar .ghost-btn {
  position: absolute;
  top: 0;
  right: 0;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 6px;
}

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

input, select {
  width: 100%;
  min-height: var(--tap);
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  padding: 0 16px;
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(91, 33, 182, 0.14);
}

.postal-row, .split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 72px; }
.show-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--primary-text);
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
  padding: 0 8px;
}

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn {
  width: 100%;
  min-height: var(--tap);
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #7c3aed, var(--primary-2));
  color: white;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 22px rgba(91, 33, 182, 0.28);
}

.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.5; box-shadow: none; }

.btn.secondary {
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--line);
}

.ghost-btn {
  border: 0;
  background: var(--primary-soft);
  color: var(--primary-text);
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.hidden { display: none !important; }

.error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(190, 18, 60, 0.18);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
}

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

.steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 2px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.step-bar {
  height: 5px;
  border-radius: 99px;
  background: rgba(28, 25, 23, 0.1);
}

.step.on .step-bar { background: var(--primary); }
.step.done .step-bar { background: #a78bfa; }

.step-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.step.on .step-label { color: var(--primary-text); }

.slot {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  color: inherit;
  min-height: 84px;
  box-shadow: var(--shadow);
}

.slot.selected {
  border-color: var(--primary);
  background: #f5f3ff;
  box-shadow: 0 0 0 4px rgba(91, 33, 182, 0.12);
}

.slot-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.slot-date {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 0;
}

.slot-time {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.muted {
  background: var(--bg-2);
  color: var(--muted);
}

.why {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  display: grid;
  place-items: center;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 10px;
}

.hero-when {
  margin: 12px 0 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.detail:last-child { border-bottom: 0; }
.detail span { color: var(--muted); }
.detail b { font-weight: 700; text-align: right; }

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.user-row:last-child { border-bottom: 0; }

.fsa-pill {
  display: inline-flex;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.sticky-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  background: rgba(246, 243, 238, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 28px rgba(28, 25, 23, 0.08);
}

.sticky-spacer { height: 8px; }

.pick-hint {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.reset-box {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.reset-box input { min-height: 44px; }
.reset-box .btn { width: auto; min-width: 88px; min-height: 44px; padding: 0 14px; }

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}
