*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sky-soft: #e0f4ff;
  --sky: #38bdf8;
  --sky-deep: #0284c7;
  --grad: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  --border: #e2e8f0;
  --muted-bg: #f8fafc;
  --muted-fg: #94a3b8;
  --fg: #1e293b;
  --red: #ef4444;
  --shadow-card: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-glow: 0 0 0 3px rgba(2,132,199,.15), 0 4px 14px rgba(2,132,199,.2);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(160deg, #f0f9ff 0%, #fafcff 55%, #f0f4ff 100%);
  min-height: 100vh;
  color: var(--fg);
  line-height: 1.5;
}

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

/* ── Header ── */
.page-header { text-align: center; margin-bottom: 2rem; }
.page-header h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); font-weight: 700; letter-spacing: -.02em; }
.page-header .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-header p { margin-top: .4rem; font-size: .875rem; color: var(--muted-fg); }

/* ── Stepper ── */
.stepper { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem; margin-bottom: 2rem; list-style: none; }
.stepper li { display: flex; align-items: center; gap: .5rem; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .8rem; flex-shrink: 0; transition: all .2s;
}
.step-num.inactive { background: var(--muted-bg); color: var(--muted-fg); }
.step-num.active   { background: var(--grad); color: #fff; }
.step-num.done     { background: var(--sky-deep); color: #fff; }
.step-lbl { font-size: .875rem; display: none; }
@media (min-width: 560px) {
  .step-lbl { display: inline; color: var(--muted-fg); }
  .step-lbl.active { font-weight: 600; color: var(--fg); }
}
.step-sep { width: 28px; height: 1px; background: var(--border); }

/* ── Cards ── */
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-card);
}
.card-soft {
  background: rgba(255,255,255,.72); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 16px; box-shadow: var(--shadow-card);
}

/* ── Buttons ── */
.btn-sky {
  background: var(--grad); color: #fff; border: none; cursor: pointer;
  font-family: inherit; font-size: .9375rem; font-weight: 500;
  border-radius: 12px; padding: .7rem 1.5rem;
  box-shadow: 0 2px 8px rgba(2,132,199,.28); transition: all .2s;
}
.btn-sky:hover:not(:disabled) { box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-sky:disabled { opacity: .5; cursor: not-allowed; filter: saturate(.4); transform: none !important; box-shadow: none !important; }

.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px; border: none;
  background: transparent; color: var(--muted-fg); font-size: .875rem;
  font-family: inherit; cursor: pointer; margin-bottom: 1rem; transition: all .15s;
}
.btn-back:hover { background: rgba(255,255,255,.65); color: var(--fg); }

/* ── Step animation ── */
@keyframes stepFade { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.step-anim { animation: stepFade .28s ease; }

/* ── Section title ── */
.section-title { font-size: clamp(1.1rem,2.5vw,1.4rem); font-weight: 600; margin-bottom: 1.25rem; }

/* ── Info box ── */
.info-box {
  border: 1px solid rgba(56,189,248,.3); background: var(--sky-soft);
  border-radius: 16px; padding: 1.1rem 1.25rem;
  display: flex; gap: .75rem; margin-top: 1rem;
}
.info-box p { font-size: .875rem; line-height: 1.65; color: rgba(30,41,59,.8); }

/* Aufmerksamkeits-Variante (z.B. Hinweis vor Reparatur) */
.info-box-warn { border-color: rgba(245,158,11,.4); background: #fef8ec; }
.info-box-warn svg { color: #d97706 !important; }

/* Kompaktes Ja/Nein-Feld (z.B. Leihgerät) */
.leih-field {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding: .8rem 1.25rem; margin-top: 1rem;
}
.leih-label { font-size: .9rem; font-weight: 500; }
.leih-sub { font-size: .7rem; color: var(--muted-fg); margin-top: 2px; }
.toggle-yn {
  position: relative; display: inline-flex; padding: 3px;
  background: var(--muted-bg); border: 1px solid var(--border); border-radius: 999px;
}
.yn-thumb {
  position: absolute; top: 3px; left: 3px; bottom: 3px; width: calc(50% - 3px);
  border-radius: 999px; background: var(--grad);
  box-shadow: 0 1px 4px rgba(2,132,199,.35); transition: transform .25s ease;
}
.toggle-yn[data-val="nein"] .yn-thumb { transform: translateX(100%); }
.yn-opt {
  position: relative; z-index: 1; width: 4rem; text-align: center;
  border: none; background: transparent; font-family: inherit;
  font-size: .85rem; font-weight: 600; color: var(--muted-fg);
  padding: .38rem 0; border-radius: 999px; cursor: pointer; transition: color .2s;
}
.toggle-yn[data-val="ja"]   .yn-opt[data-leih="ja"],
.toggle-yn[data-val="nein"] .yn-opt[data-leih="nein"] { color: #fff; }
@media (prefers-reduced-motion: reduce) { .yn-thumb { transition: none; } }

/* ── STEP 1 – Device grid ── */
.device-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .875rem; }
@media (min-width: 560px) { .device-grid { grid-template-columns: repeat(3,1fr); } }

.device-card {
  border: 1px solid var(--border); background: #fff;
  border-radius: 16px; padding: .75rem;
  cursor: pointer; text-align: left;
  box-shadow: var(--shadow-card); transition: all .2s;
  font-family: inherit;
}
.device-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.device-card.selected { border-color: var(--sky-deep); box-shadow: var(--shadow-glow); outline: 2px solid rgba(2,132,199,.25); }
.device-card .img-wrap { aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--sky-soft); }
.device-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; display: block; }
.device-card:hover img { transform: scale(1.06); }
.device-foot { margin-top: .65rem; padding: 0 2px; display: flex; align-items: center; justify-content: space-between; }
.device-name { font-weight: 500; font-size: .9rem; }
.device-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); transition: all .2s; }
.device-card.selected .device-dot { background: var(--sky-deep); border-color: var(--sky-deep); }

/* Nicht klickbare Geräte-Collage (Schritt 1) */
.device-card.static { cursor: default; }
.device-card.static:hover { transform: none; box-shadow: var(--shadow-card); }
.device-card.static:hover img { transform: none; }

/* ── STEP 2 – Termin ── */
.termin-box { padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.field-label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .45rem; }

.week-list { display: flex; flex-direction: column; gap: .6rem; }
.week-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; text-align: left; font-family: inherit; cursor: pointer;
  border: 1px solid var(--border); background: #fff; border-radius: 12px;
  padding: .75rem 1rem; transition: all .15s;
}
.week-row:hover { border-color: var(--sky-deep); background: var(--sky-soft); }
.week-row.selected { border-color: var(--sky-deep); box-shadow: var(--shadow-glow); }
.week-kw { font-weight: 600; font-size: .9rem; }
.week-range { font-size: .8rem; color: var(--muted-fg); flex: 1; text-align: right; margin-right: .5rem; }
.week-tag { font-size: .7rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--sky-soft); color: var(--sky-deep); white-space: nowrap; }

select.inp, input.inp, textarea.inp {
  width: 100%; border: 1px solid var(--border); background: #fff;
  border-radius: 12px; padding: .625rem 1rem;
  font-size: .9375rem; font-family: inherit;
  outline: none; color: var(--fg); transition: border-color .15s, box-shadow .15s;
}
select.inp:focus, input.inp:focus, textarea.inp:focus {
  border-color: var(--sky-deep); box-shadow: 0 0 0 3px rgba(2,132,199,.13);
}
select.inp.err, input.inp.err, textarea.inp.err {
  border-color: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.next-bar { display: flex; justify-content: flex-end; margin-top: 1.5rem; }

/* ── STEP 3/4 – Leistung & Reparaturfreigabe ── */
.pkgs-grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 720px) { .pkgs-grid { grid-template-columns: repeat(3,1fr); } }

.pkg-card {
  position: relative; border: 1px solid var(--border); background: #fff;
  border-radius: 16px; padding: 1.25rem;
  cursor: pointer; text-align: left;
  box-shadow: var(--shadow-card); transition: all .2s; font-family: inherit;
}
.pkg-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.pkg-card.selected { border-color: var(--sky-deep); box-shadow: var(--shadow-glow); outline: 2px solid rgba(2,132,199,.2); }
.pkg-badge {
  position: absolute; top: -10px; right: 1rem;
  background: var(--grad); color: #fff;
  font-size: .6rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 10px; border-radius: 999px;
}
.pkg-name { font-size: 1.05rem; font-weight: 600; }
.pkg-price-row { margin-top: .4rem; display: flex; align-items: baseline; gap: 4px; }
.pkg-price { font-size: 1.45rem; font-weight: 700; color: var(--sky-deep); }
.pkg-note { font-size: .7rem; color: var(--muted-fg); }
.pkg-features { margin-top: .9rem; list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.pkg-features li { display: flex; gap: .45rem; font-size: .85rem; color: rgba(30,41,59,.8); align-items: flex-start; }
.pkg-features li svg { flex-shrink: 0; margin-top: 2px; }

/* Schritt "Leistung" (Wartung/Reparatur) – Mehrfachauswahl statt Radio */
.leistung-grid { grid-template-columns: repeat(2,1fr) !important; }
.leistung-desc { margin-top: .5rem; font-size: .85rem; color: rgba(30,41,59,.8); }

.versand-box { padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.versand-box h4 { font-size: .875rem; font-weight: 600; margin-bottom: .65rem; }
.versand-lbl {
  display: flex; align-items: flex-start; gap: .75rem;
  border: 1px solid var(--border); border-radius: 12px; padding: .75rem;
  cursor: pointer; transition: background .15s;
}
.versand-lbl:hover { background: var(--sky-soft); }
.versand-lbl input[type=checkbox] { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--sky-deep); flex-shrink: 0; }
.versand-inner { flex: 1; }
.versand-row { display: flex; align-items: center; justify-content: space-between; }
.versand-name { font-weight: 500; font-size: .9rem; }
.versand-price { font-size: .875rem; font-weight: 600; color: var(--sky-deep); }
.versand-desc { font-size: .75rem; color: var(--muted-fg); margin-top: 2px; }

/* ── STEP 5 – Form ── */
.device-confirm { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.device-confirm .btn-outline { margin-top: 0; }
.device-confirm-name { font-size: .9375rem; font-weight: 600; margin-top: .35rem; }
.device-confirm-sn { font-size: .8rem; color: var(--muted-fg); }

.form-section { margin-bottom: 1rem; padding: 1.25rem 1.5rem; }
.form-section legend { padding: 0 8px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sky-deep); }
.form-row { display: grid; gap: 1rem; margin-top: 1rem; }
@media (min-width: 720px) {
  .form-row { grid-template-columns: repeat(3,1fr); }
  .form-row.cols-2 { grid-template-columns: repeat(2,1fr); }
}
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld > label { font-size: .75rem; font-weight: 500; color: rgba(30,41,59,.8); }
.fld-err { font-size: .68rem; color: var(--red); }
.fld-hint { font-size: .68rem; color: var(--muted-fg); }
.toggle-lbl {
  display: flex; align-items: center; gap: .75rem;
  border: 1px solid var(--border); background: #fff;
  border-radius: 12px; padding: .7rem 1rem;
  font-size: .875rem; cursor: pointer; transition: background .15s; margin-top: .75rem;
}
.toggle-lbl:hover { background: var(--sky-soft); }
.toggle-lbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--sky-deep); }
textarea.inp { resize: vertical; min-height: 120px; }
.form-submit-row { display: flex; justify-content: flex-end; margin-top: 1rem; }

/* ── STEP 6 – Summary ── */
.summary-grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 720px) {
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .summary-grid .full { grid-column: 1/-1; }
}
.sum-card { padding: 1.1rem 1.25rem; }
.sum-card-title { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sky-deep); margin-bottom: .65rem; }
.sum-line { display: flex; justify-content: space-between; gap: .75rem; font-size: .875rem; padding: 3px 0; }
.sum-line .lbl { color: var(--muted-fg); }
.sum-line .val { font-weight: 500; text-align: right; }
.sum-divider { border-top: 1px solid var(--border); margin: .6rem 0; }
.sum-total { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); margin-top: .75rem; padding-top: .75rem; }
.sum-total-lbl { font-size: .875rem; font-weight: 600; }
.sum-total-val { font-size: 1.25rem; font-weight: 700; color: var(--sky-deep); }

/* ── Confirmation ── */
.confirm-wrap { max-width: 480px; margin: 0 auto; padding: 2.5rem 1.5rem; text-align: center; }
.confirm-icon {
  width: 64px; height: 64px; background: var(--grad);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
}
.confirm-icon svg { width: 32px; height: 32px; }
.confirm-title { font-size: 1.5rem; font-weight: 700; }
.confirm-ref { margin-top: .5rem; font-size: .95rem; color: var(--sky-deep); }
.confirm-text { margin-top: .75rem; font-size: .875rem; color: rgba(30,41,59,.8); line-height: 1.65; }
/* Fehlermeldung beim Absenden der Buchung (Schritt Übersicht) */
.order-error {
  margin-top: 1rem; padding: .75rem 1rem; border-radius: 12px;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  font-size: .875rem; line-height: 1.5;
}
.confirm-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.confirm-actions .btn-outline { margin-top: 0; }
.btn-outline {
  margin-top: 1.5rem; border: 1px solid var(--border); background: #fff;
  border-radius: 12px; padding: .6rem 1.25rem; font-size: .875rem;
  font-weight: 500; font-family: inherit; cursor: pointer; transition: background .15s;
}
.btn-outline:hover { background: var(--sky-soft); }

footer { margin-top: 3rem; text-align: center; font-size: .75rem; color: var(--muted-fg); }
.space-y > * + * { margin-top: 1rem; }
