:root {
  color-scheme: light;
  --ink: #16202a;
  --muted: #61707d;
  --line: #d9e0e5;
  --surface: #ffffff;
  --canvas: #f4f6f7;
  --accent: #176b87;
  --accent-dark: #0f5269;
  --accent-soft: #e8f3f6;
  --danger: #a33131;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
}

button, input { font: inherit; }

.page-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 32px 18px;
}

.card {
  width: min(100%, 560px);
  padding: clamp(28px, 6vw, 56px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(22, 32, 42, 0.08);
}

.eyebrow {
  margin: 22px 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1, h2, p { text-wrap: pretty; }

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.intro {
  margin: 18px 0 32px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.delivery-note {
  margin: -12px 0 28px;
  padding: 14px 16px;
  border: 1px solid #c5dfe5;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.delivery-note strong { font-weight: 750; }

.maintenance-note {
  margin: -10px 0 28px;
  padding: 13px 15px;
  border: 1px solid #e4c8a6;
  border-radius: 12px;
  background: #fff7eb;
  color: #704a1f;
  font-size: 14px;
  line-height: 1.5;
}

.maintenance-note[hidden] { display: none; }

label {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 650;
}

.input-row {
  display: flex;
  gap: 10px;
}

input {
  min-width: 0;
  flex: 1;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fbfcfc;
  font-variant-numeric: tabular-nums;
}

input::placeholder { color: #8b98a3; }

button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

button:hover { background: var(--accent-dark); }
button:disabled { cursor: wait; opacity: 0.62; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(23, 107, 135, 0.3); outline-offset: 3px; }

.helper, .privacy-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-error {
  min-height: 21px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.order-panel {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.status-heading-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.status-heading-row .eyebrow { margin-top: 0; }

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.ready { background: #e6f5e9; color: #216d35; }
.status-badge.failed { background: #fae9e9; color: var(--danger); }

.order-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.order-facts div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

dt { color: var(--muted); font-size: 12px; }
dd { margin: 6px 0 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

.status-message { min-height: 26px; margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.order-actions { display: flex; gap: 10px; }
.order-actions button { flex: 1; width: 100%; }
.download-button { background: var(--ink); }
.download-button:hover { background: #293945; }
.secondary-button { border: 1px solid #b8d8df; background: var(--accent-soft); color: var(--accent-dark); }
.secondary-button:hover { background: #d6ebef; }

.privacy-note { margin-top: 26px; }

@media (max-width: 520px) {
  .input-row { flex-direction: column; }
  .input-row button { width: 100%; }
  .order-actions { flex-direction: column; }
  .order-facts { grid-template-columns: 1fr; }
  .card { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
