:root {
  --bg: #f4f1ec;
  --surface: #ffffff;
  --text: #1f1b16;
  --text-muted: #6b6259;
  --border: #ece6dc;
  --accent: #e8622c;
  --accent-soft: #fdece2;
  --success: #2f9e5c;
  --success-soft: #e6f6ec;
  --shadow: 0 1px 2px rgba(31, 27, 22, 0.04), 0 8px 24px rgba(31, 27, 22, 0.06);
  --radius-lg: 20px;
  --radius-md: 14px;
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --surface: #201c17;
    --text: #f3ede4;
    --text-muted: #a89e91;
    --border: #322c24;
    --accent: #ff7a42;
    --accent-soft: #3a2417;
    --success: #4cc984;
    --success-soft: #16301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.header-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.order-number {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.order-number span {
  font-weight: 600;
  color: var(--text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem;
  flex: 1;
}

.loading {
  color: var(--text-muted);
  text-align: center;
  margin: 1rem 0;
}

.error {
  color: var(--text-muted);
  text-align: center;
  margin: 1rem 0;
}

/* Stepper */
.stepper {
  list-style: none;
  margin: 0;
  padding: 0;
}

.step {
  position: relative;
  display: flex;
  gap: 0.9rem;
  padding-bottom: 1.6rem;
}

.step:last-child {
  padding-bottom: 0;
}

.step-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.step-dot {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.step-line {
  width: 2px;
  flex: 1;
  min-height: 1.6rem;
  background: var(--border);
  margin-top: 2px;
  transition: background 0.3s;
}

.step-body {
  padding-top: 0.3rem;
  flex: 1;
}

.step-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-muted);
  transition: color 0.3s;
}

.step-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Completed step */
.step.is-done .step-dot {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.step.is-done .step-line {
  background: var(--success);
}

.step.is-done .step-title {
  color: var(--text);
}

/* Current step */
.step.is-current .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.step.is-current .step-title {
  color: var(--text);
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 var(--accent-soft); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.step.is-current .step-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse-ring 2s ease-out infinite;
}

/* Countdown */
.countdown {
  margin-top: 0.75rem;
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.countdown-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.countdown-time {
  font-size: 1.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--text);
}

.countdown-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Ready state hero */
.ready-hero {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.ready-hero .emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.ready-hero h2 {
  margin: 0 0 0.3rem;
  font-size: 1.25rem;
}

.ready-hero p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.92rem;
}

.footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.footer p {
  margin: 0.2rem 0;
}

.fun-note {
  opacity: 0.75;
}

/* Slightly wider viewports still center nicely; mobile remains primary target */
@media (min-width: 480px) {
  .page {
    padding-top: 3rem;
  }
}
