/* PrintPod — design language after Dieter Rams:
   as little design as possible, thorough down to the last detail.
   One accent color, reserved for the primary action. Everything else is
   paper, ink, and hairlines. */

* {
  box-sizing: border-box;
}

:root {
  --paper: #f3f1ee;      /* warm paper-white ground */
  --surface: #ffffff;
  --ink: #1a1917;
  --ink-muted: #75726c;
  --line: #e6e3dd;       /* hairline */
  --line-strong: #d4d0c8;
  --track: #ebe8e3;      /* recessed track behind segmented controls */
  --accent: #e8500a;     /* Braun orange — primary action only */
  --accent-down: #c94100;
  --ok: #33691e;
  --ok-bg: #f2f5ee;
  --ok-line: #d5ddc8;
  --err: #b3391f;
  --err-bg: #faf0ec;
  --err-line: #e8cfc4;
  --radius: 8px;
  --radius-sm: 6px;
  --raise: 0 1px 2px rgba(26, 25, 23, 0.14);
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 900px) {
  body {
    font-size: 17px;
  }
}

.shell {
  max-width: 500px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.mark {
  width: 48px;
  height: 48px;
  background: var(--ink);
  color: var(--surface);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mark svg {
  width: 25px;
  height: 25px;
}

.masthead h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.tagline {
  margin: 0.15rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* ---------- Sheet (the one card) ---------- */

.sheet {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  margin: 0;
  padding: 0;
  box-shadow: 0 1px 2px rgba(26, 25, 23, 0.04), 0 16px 40px -20px rgba(26, 25, 23, 0.16);
  overflow: hidden;
}

.section {
  padding: 1.4rem 1.5rem;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-title {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- File picker ---------- */

.file-drop {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop:hover,
.file-drop:focus-within {
  border-color: var(--ink);
  background: #fcfbfa;
}

.file-drop.has-file {
  border-style: solid;
}

.file-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-icon {
  width: 44px;
  height: 44px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.file-icon svg {
  width: 26px;
  height: 26px;
}

.file-drop.has-file .file-icon {
  color: var(--accent);
}

.file-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-name {
  font-weight: 500;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.file-drop.has-file .file-name {
  color: var(--ink);
}

.file-hint {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Select ---------- */

select {
  font: inherit;
  width: 100%;
  padding: 0.75rem 2.6rem 0.75rem 0.9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
  /* Phosphor: caret-down */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%2375726c'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

select:hover:not(:disabled) {
  border-color: var(--ink);
}

select:disabled {
  color: var(--ink-muted);
  cursor: not-allowed;
}

.select-inline {
  width: auto;
  min-width: 5rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Focus (one consistent ring everywhere) ---------- */

select:focus-visible,
button:focus-visible,
input[type="number"]:focus-visible,
.file-drop:focus-within,
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- Option rows ---------- */

.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

/* Rows revealed by a "Custom" choice — visually attached to the row above. */
.opt-reveal {
  border-top: none;
  padding-top: 0;
}

.text-input {
  font: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  width: 5.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.text-input-wide {
  width: 10rem;
  text-align: left;
}

.text-input::placeholder {
  color: var(--ink-muted);
}

.text-input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.suffix-input {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-muted);
  font-size: 1rem;
}

.section-title + .opt {
  border-top: none;
  padding-top: 0;
}

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

.opt-label {
  font-size: 1rem;
}

.opt-switch {
  cursor: pointer;
}

/* ---------- Stepper ---------- */

.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.stepper button {
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  width: 2.7rem;
  padding: 0.55rem 0;
  border: none;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
}

.stepper button:hover {
  background: var(--paper);
}

.stepper button:active {
  background: var(--track);
}

.stepper input {
  font: inherit;
  width: 3.1rem;
  text-align: center;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* The stepper clips overflow, so focus rings must sit inside its border. */
.stepper input:focus-visible,
.stepper button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

/* ---------- Segmented control ---------- */

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--track);
  border-radius: var(--radius);
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.segmented span {
  display: block;
  min-width: 3.6rem;
  padding: 0.5rem 0.9rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.segmented span:hover {
  color: var(--ink);
}

.segmented input:checked + span {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--raise);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

/* ---------- Switch ---------- */

.switch input {
  appearance: none;
  -webkit-appearance: none;
  width: 2.85rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
  display: block;
  margin: 0;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.6rem - 4px);
  height: calc(1.6rem - 4px);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.switch input:checked {
  background: var(--ink);
}

.switch input:checked::after {
  transform: translateX(1.25rem);
}

.switch input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.opt-switch:has(input:disabled) {
  cursor: not-allowed;
}

.opt-switch:has(input:disabled) .opt-label {
  color: var(--ink-muted);
}

/* ---------- Progress + submit ---------- */

.section-submit {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.progress {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}

button[type="submit"] {
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--accent-down);
}

button[type="submit"]:active:not(:disabled) {
  transform: translateY(1px);
}

button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* ---------- Wide layout (large screens) ---------- */

@media (min-width: 900px) {
  .shell-wide {
    max-width: 1060px;
    padding: 3.5rem 2.5rem 2.5rem;
  }

  .shell-wide .masthead {
    margin-bottom: 2rem;
  }

  .shell-wide .sheet {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "error  error"
      "doc    options"
      "pod    options"
      ".      options"
      "submit submit";
  }

  .shell-wide .sheet > .notice {
    grid-area: error;
    margin: 1.5rem 1.9rem 0;
  }

  .shell-wide .section {
    padding: 1.75rem 1.9rem;
  }

  .section-doc {
    grid-area: doc;
  }

  .section-pod {
    grid-area: pod;
  }

  .section-options {
    grid-area: options;
    border-top: none;
    border-left: 1px solid var(--line);
  }

  .section-submit {
    grid-area: submit;
    border-top: 1px solid var(--line);
    padding-top: 1.4rem;
    padding-bottom: 1.4rem;
  }

  .shell-wide .file-drop {
    padding: 1.5rem 1.4rem;
  }
}

/* ---------- Notices ---------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.notice svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.notice-error {
  background: var(--err-bg);
  border-color: var(--err-line);
  color: var(--err);
}

.notice-ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}

/* Error banner at the top of the upload sheet */
.sheet > .notice {
  margin: 1.4rem 1.5rem 0;
}

/* Notices inside the status card sit under the headline */
.section .notice {
  margin-top: 1rem;
}

/* ---------- Status page ---------- */

.status-headline {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.status-detail {
  margin: 0.3rem 0 0;
  color: var(--ink-muted);
  font-size: 1rem;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0;
  color: var(--ink-muted);
  font-size: 1rem;
}

/* connecting hairline between dots */
.steps li + li::before {
  content: "";
  position: absolute;
  left: calc(0.8rem - 0.5px);
  top: -0.6rem;
  height: 1.2rem;
  width: 1px;
  background: var(--line);
}

.steps .dot {
  width: 1.6rem;
  height: 1.6rem;
  flex-shrink: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.steps .dot svg {
  width: 14px;
  height: 14px;
}

.steps li.done {
  color: var(--ink);
}

.steps li.done .dot {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.steps li.active {
  color: var(--ink);
  font-weight: 600;
}

.steps li.active .dot {
  border-color: var(--accent);
}

.steps li.active .dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: breathe 1.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.status-meta {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ---------- Back link + colophon ---------- */

.back-link {
  margin: 1.5rem 0 0;
  text-align: center;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: border-color 0.15s ease;
}

.back-link a:hover {
  border-color: var(--ink);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.colophon {
  margin-top: 2.5rem;
  text-align: center;
}

.colophon p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.colophon a {
  color: inherit;
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
