/* Design tokens — Kanton Luzern / gerichte.lu.ch */
:root {
  --warm-50: #ffffff;
  --warm-100: #f5f5f5;
  --warm-200: #d7e3eb;
  --warm-800: #1b2a35;
  --warm-900: #1b2a35;
  --muted: #5a6a78;
  --primary: #009fe3;
  --primary-hover: #0077b0;
  --primary-light: #e6f4fa;
  --accent: #0b4f7a;
  --accent-hover: #083d5e;
  --accent-light: #e6f4fa;
  --link: #2d6e96;
  --max-width: 28rem;
  --radius: 0.25rem;
  --radius-lg: 0.375rem;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto !important;
}

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

body {
  margin: 0;
  font-family: "Noto Sans", "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--warm-900);
  background: #fff;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100dvh;
}

.screen-top {
  display: block !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  scroll-margin-top: 0 !important;
}

[data-page-title] {
  scroll-margin-top: 5.75rem !important;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* Layout */
.page {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
}

.main {
  flex: 1;
  padding: 1.5rem 1.25rem 2rem;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Typography */
.lead { font-size: 1.125rem; line-height: 1.625; color: var(--warm-800); }
.heading-xl { font-size: 1.875rem; font-weight: 600; line-height: 1.2; margin: 0 0 1.25rem; }
.heading-lg { font-size: 1.5rem; font-weight: 600; margin: 0 0 0.75rem; }
.heading-md { font-size: 1.25rem; font-weight: 600; margin: 0 0 1rem; }
.heading-sm { font-size: 1.125rem; font-weight: 600; margin: 0 0 0.25rem; }
.label-upper {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.text-center { text-align: center; }

/* Hero icon */
.hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  margin-bottom: 2rem;
  border-radius: var(--radius-lg);
  background: var(--primary-light);
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1.125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-secondary {
  background: #fff;
  color: var(--warm-900);
  border: 2px solid var(--warm-200);
}
.btn-secondary:hover { border-color: var(--primary); }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  margin-bottom: 1.5rem;
  padding: 0;
  border: none;
  background: none;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--warm-800);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-link {
  min-height: 3rem;
  padding: 0.5rem;
  border: none;
  background: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--warm-800);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.btn-list {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--warm-200);
  border-radius: var(--radius-lg);
  background: #fff;
  font-size: 1.125rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--warm-900);
  text-align: left;
  cursor: pointer;
}
.btn-list:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.btn-stack { display: flex; flex-direction: column; gap: 1rem; }

/* Cards */
.card {
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 1.25rem;
  box-shadow: none;
  border: 1px solid var(--warm-200);
}

.card-highlight {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 2rem;
  background: var(--warm-100);
  text-align: center;
}

.card-highlight p {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.625;
}

/* Key messages grid */
.key-messages {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

@media (min-width: 420px) {
  .key-messages { grid-template-columns: 1fr 1fr; }
}

.key-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 2px solid;
}

.key-card--good {
  border-color: var(--primary);
  background: var(--primary-light);
}

.key-card--deadline {
  border-color: var(--accent);
  background: var(--primary-light);
}

.key-card__label {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.key-card--good .key-card__label { color: var(--primary); }
.key-card--deadline .key-card__label { color: var(--accent); }

.key-card__text {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.625;
}

.key-card__deadline {
  margin: 0.5rem 0 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
}

/* Process steps */
.process-steps { list-style: none; padding: 0; margin: 0; }
.process-step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.process-step:last-child { margin-bottom: 0; }

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 700;
}

.step-num--accent {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 1.125rem;
}

.steps-list { list-style: none; padding: 0; margin: 0 0 2.5rem; }
.steps-list li { margin-bottom: 1.5rem; }
.steps-list li:last-child { margin-bottom: 0; }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0;
}
.divider__line { flex: 1; height: 1px; background: var(--warm-200); }

/* Letter type list */
.type-list { list-style: none; padding: 0; margin: 0; }
.type-list li { margin-bottom: 0.75rem; }
.type-list li:last-child { margin-bottom: 0; }

/* Deadline banner */
.deadline-banner {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  text-align: center;
  background: var(--primary-light);
  border-bottom: 1px solid var(--warm-200);
}

.deadline-banner p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.deadline-banner p + p {
  font-weight: 400;
  color: var(--warm-800);
}

/* Photo preview */
.photo-preview {
  overflow: hidden;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--warm-200);
}

.photo-preview img {
  display: block;
  width: 100%;
  max-height: 10rem;
  object-fit: cover;
}

/* Form */
.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
}

.field-input {
  width: 100%;
  min-height: 3rem;
  margin-bottom: 1rem;
  padding: 0 1rem;
  border: 2px solid var(--warm-200);
  border-radius: var(--radius-lg);
  background: #fff;
  font-size: 1rem;
  font-family: inherit;
  color: var(--warm-900);
}

.file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.status-msg {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--warm-800);
}

/* Contact card */
.contact-card { margin-bottom: 1rem; }
.contact-card:last-child { margin-bottom: 0; }

.contact-card--send {
  border-color: var(--primary);
  background: var(--primary-light);
}

.contact-card__tag {
  display: inline-block;
  margin: 0 0 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.contact-card--advice .contact-card__tag {
  background: var(--warm-100);
  color: var(--accent);
}

.contact-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
}

.contact-card .subtitle {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.contact-card dl { margin: 0; }
.contact-card dt {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}
.contact-card dd {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}
.contact-card dd:last-child { margin-bottom: 0; }

/* Explain sections */
.section-list { margin-bottom: 2.5rem; }
.section-item { margin-bottom: 1rem; }
.section-item:last-child { margin-bottom: 0; }

.tip-box {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--primary-light);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
}

/* Links */
a.link {
  font-weight: 500;
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Footer */
.trust-footer {
  margin-top: auto;
  padding: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted);
  background: var(--warm-100);
  border-top: 1px solid var(--warm-200);
}

.trust-footer p { margin: 0; }
.trust-footer p + p { margin-top: 0.5rem; }
.trust-footer strong { color: var(--warm-900); font-weight: 600; }

/* Camera frame (A4 portrait) */
.camera-stage {
  position: relative;
  width: 100%;
  max-width: 16rem;
  margin: 0 auto 1.5rem;
  aspect-ratio: 210 / 297;
  border-radius: 0.75rem;
  overflow: hidden;
  background: linear-gradient(145deg, #1b2a35, #0b4f7a);
  box-shadow: inset 0 0 0 1px rgba(0, 159, 227, 0.2);
}

.camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1b2a35;
}

.camera-hint {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  z-index: 3;
}

.camera-frame {
  position: absolute;
  inset: 10%;
  border: 3px solid #fff;
  border-radius: 0.35rem;
  box-shadow: 0 0 0 9999px rgba(27, 42, 53, 0.48);
  pointer-events: none;
  z-index: 2;
}

/* Scanning */
.page--scan .scan-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70dvh;
}

.scan-container {
  text-align: center;
}

.scan-preview {
  position: relative;
  width: 100%;
  max-width: 16rem;
  margin: 0 auto 1.5rem;
  overflow: hidden;
  border-radius: 0.75rem;
  background: var(--warm-200);
  box-shadow: 0 8px 28px rgba(27, 42, 53, 0.12);
}

.scan-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 18%;
  top: -18%;
  background: linear-gradient(to bottom, transparent, rgba(0, 159, 227, 0.35), transparent);
  animation: scanSweep 1.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes scanSweep {
  from { top: -18%; }
  to { top: 100%; }
}

.scan-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .scan-line { animation: none; top: 40%; opacity: 0.5; }
}

/* Section tour map */
.tour-progress {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.tour-map {
  position: relative;
  width: 100%;
  max-width: 16rem;
  margin: 0 auto 1rem;
  overflow: hidden;
  border-radius: 0.75rem;
  background: var(--warm-100);
  box-shadow: 0 4px 20px rgba(27, 42, 53, 0.1);
}

.tour-photo {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.tour-spotlight {
  position: absolute;
  border: 3px solid var(--accent);
  border-radius: 0;
  box-shadow: 0 0 0 9999px rgba(27, 42, 53, 0.5);
  pointer-events: none;
  z-index: 2;
}

.tour-hotspots {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.tour-hotspot {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 2px dashed rgba(255, 255, 255, 0.8);
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, border-color 0.15s;
}

.tour-hotspot:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.tour-hotspot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.tour-hotspot.is-active {
  border-color: transparent;
}

.tour-hotspot__num {
  position: absolute;
  top: 3px;
  left: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--warm-900);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.tour-hotspot.is-active .tour-hotspot__num {
  background: var(--accent);
  color: #fff;
}

.tour-hint {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  text-align: center;
  color: var(--muted);
}

.tour-ref-note {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  text-align: center;
  color: var(--muted);
}

.tour-text p {
  margin: 0;
  line-height: 1.6;
}

.tour-text--watch {
  border-left: 4px solid var(--accent);
}

.tour-text--watch .heading-sm {
  color: var(--accent);
}

/* Flow additions */
.sticky-stack {
  position: sticky;
  top: 0;
  z-index: 30;
}

.sticky-stack .deadline-banner {
  position: static;
}

.tone-bar {
  background: #fff;
  color: var(--warm-900);
  border-bottom: 1px solid var(--warm-200);
}

.tone-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
}

.tone-bar__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.tone-switch {
  display: flex;
  flex: 1;
  min-width: 12rem;
  border: 2px solid var(--warm-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tone-seg {
  flex: 1;
  min-height: 2.5rem;
  padding: 0.35rem 0.4rem;
  border: none;
  background: transparent;
  color: var(--warm-800);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.tone-seg + .tone-seg {
  border-left: 2px solid var(--warm-200);
}

.tone-seg.is-active {
  background: var(--primary);
  color: #fff;
}

.portfolio-block .new-panel {
  position: relative;
  margin-bottom: 1.25rem;
}

.cost-headline {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 7vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--warm-900);
}

.cost-amount {
  display: inline-block;
  padding: 0.05em 0.2em;
  background: var(--primary-light);
  box-shadow: 0.2em 0 0 var(--primary-light), -0.2em 0 0 var(--primary-light);
  color: var(--accent);
}

.cost-sub {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--warm-900);
}

.countdown-block {
  margin: 1.25rem 0;
  padding: 1.1rem 1.15rem;
  background: var(--primary-light);
  color: var(--warm-900);
  border: 1px solid var(--warm-200);
  border-radius: var(--radius-lg);
}

.countdown-block__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.countdown-block__msg {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}

.countdown-block .field-input {
  margin-bottom: 0;
}

.check-progress {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.choice-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-choice {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.9rem 1.1rem;
  border: 2px solid var(--warm-200);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--warm-900);
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.btn-choice.is-selected,
.btn-choice:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.traffic-card {
  padding: 1.35rem 1.2rem;
  border: 1px solid var(--warm-200);
  border-radius: var(--radius-lg);
  margin-bottom: 0.85rem;
  background: #fff;
}

.traffic-card--yellow {
  background: var(--primary-light);
  color: var(--warm-900);
}

.traffic-card--orange {
  background: #fff;
  border-color: var(--accent);
  color: var(--warm-900);
}

.traffic-card__title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
}

.traffic-card__text {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
}

.proto-note {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.letter-fields {
  margin-bottom: 1rem;
}

.letter-sheet {
  background: #fff;
  padding: 1.5rem 1.25rem 1.75rem;
  margin-bottom: 0.85rem;
  border: 1px solid var(--warm-200);
  box-shadow: 0 8px 24px rgba(27, 42, 53, 0.08);
  font-family: Georgia, "Noto Sans", serif;
  color: var(--warm-900);
  line-height: 1.55;
}

.letter-sheet p {
  margin: 0 0 0.85rem;
}

.letter-meta {
  font-size: 0.95rem;
}

.letter-subject {
  margin-bottom: 1.1rem;
}

.letter-fill {
  background: var(--primary-light);
  color: var(--accent);
  font-weight: 700;
  padding: 0 0.15em;
}

.letter-sign-line {
  display: block;
  width: 12rem;
  height: 2.25rem;
  margin-top: 0.35rem;
  border-bottom: 1px solid var(--warm-200);
}

.letter-explain {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.letter-steps {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0.9rem 1.1rem;
  background: var(--primary-light);
  border: 1px solid var(--warm-200);
  border-radius: var(--radius-lg);
  color: var(--warm-900);
  font-weight: 600;
}

.letter-steps li {
  line-height: 1.4;
}

.letter-contacts {
  margin: 1rem 0 1.25rem;
}

.letter-contacts .heading-md {
  margin-top: 0.5rem;
}

.letter-deadline {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.number-edit {
  margin-top: 0.75rem;
}

@media print {
  .sticky-stack,
  .btn-back,
  .trust-footer,
  .letter-fields,
  .letter-explain,
  .btn-stack,
  .letter-steps,
  .letter-contacts,
  .letter-deadline,
  .status-msg,
  .tone-bar,
  .deadline-banner {
    display: none !important;
  }

  body.print-letter * {
    visibility: hidden;
  }

  body.print-letter .letter-sheet,
  body.print-letter .letter-sheet * {
    visibility: visible;
  }

  body.print-letter .letter-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
    border: none;
  }
}
