@font-face {
  font-family: 'NIKARI Lato';
  src: url('/assets/lato-light.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'NIKARI Lato';
  src: url('/assets/lato-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'NIKARI Lato';
  src: url('/assets/lato-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --brand-cream: #f8f3ed;
  --brand-navy: #111923;
  --brand-gold: #c5a969;
  --paper: var(--brand-cream);
  --ink: var(--brand-navy);
  --muted: color-mix(in srgb, var(--ink) 78%, var(--paper));
  --accent-link: var(--ink);
  --border: color-mix(in srgb, var(--ink) 24%, var(--paper));
  --field-border: color-mix(in srgb, var(--ink) 60%, var(--paper));
  --hover: color-mix(in srgb, var(--ink) 9%, var(--paper));
  --button-fill: var(--brand-navy);
  --button-text: var(--brand-cream);
  --button-hover: color-mix(in srgb, var(--button-fill) 82%, var(--brand-gold));
  --focus: var(--ink);
  --error: #8f2b25;
  --error-fill: #f8eae7;
  --error-text: #752320;
  --error-border: #e7b9b2;
  --status-fill: color-mix(in srgb, var(--brand-gold) 18%, var(--paper));
  --card-shadow: 0 12px 28px color-mix(in srgb, var(--brand-navy) 9%, transparent);
  --width: 1232px;
  --gutter: clamp(1rem, 5vw, 4.25rem);
  font: 1rem/1.55 'NIKARI Lato', 'Helvetica Neue', Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: var(--brand-navy);
  --ink: var(--brand-cream);
  --accent-link: var(--brand-gold);
  --button-fill: var(--brand-gold);
  --button-text: var(--brand-navy);
  --button-hover: color-mix(in srgb, var(--button-fill) 82%, var(--brand-cream));
  --focus: var(--brand-gold);
  --error: #f1a9a1;
  --error-fill: #38282d;
  --error-text: #ffd3ce;
  --error-border: #89545a;
  --card-shadow: 0 12px 34px color-mix(in srgb, var(--brand-navy) 45%, transparent);
}

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

[hidden] { display: none !important; }

body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
img { display: block; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
#status-title:focus { outline: none; }

.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip:focus {
  position: absolute;
  padding: .75rem 1rem;
  top: .5rem;
  left: .5rem;
  z-index: 2;
  background: var(--paper);
  border-radius: .5rem;
}

.header {
  width: min(calc(100% - 2 * var(--gutter)), var(--width));
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}

.header { padding-block: clamp(.95rem, 2.5vw, 1.65rem); }
.header nav { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem clamp(.65rem, 2.5vw, 1.5rem); }
.header nav a { font-size: .9rem; font-weight: 700; color: var(--ink); }
.header nav a { display: inline-flex; align-items: center; min-height: 44px; padding: .45rem .7rem; border-radius: .55rem; }
.header nav a:hover { background: var(--hover); }
.header nav .sign-in { padding-inline: .95rem; border: 1px solid var(--border); }
.brand { display: inline-flex; gap: .65rem; align-items: center; font-size: 1rem; font-weight: 700; letter-spacing: .15em; }
.brand-mark-dark, :root[data-theme="dark"] .brand-mark-light { display: none; }
:root[data-theme="dark"] .brand-mark-dark { display: block; }

.demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4.5vw, 4.1rem);
  width: min(calc(100% - 2 * var(--gutter)), var(--width));
  margin: .9rem auto 0;
  align-items: start;
}

.intro {
  overflow: hidden;
  align-self: stretch;
  min-height: 620px;
  min-width: 0;
  color: var(--brand-cream);
  border-radius: 26px;
  background-color: var(--brand-navy);
  background-image:
    linear-gradient(180deg, var(--brand-navy) 39%,
      color-mix(in srgb, var(--brand-navy) 92%, transparent) 61%,
      color-mix(in srgb, var(--brand-navy) 72%, transparent) 80%,
      color-mix(in srgb, var(--brand-navy) 20%, transparent)),
    url('/assets/vierwaldstaettersee.webp');
  background-position: center, 53% bottom;
  background-repeat: no-repeat;
  background-size: cover, auto 58%;
  box-shadow: var(--card-shadow);
}

.intro-content { padding: clamp(1.65rem, 4.25vw, 3.45rem); }
h1, h2 { margin: 0; font-weight: 300; line-height: 1.14; letter-spacing: -.032em; text-wrap: balance; }
h1 { max-width: 13ch; font-size: clamp(2.45rem, 4.2vw, 3.85rem); }
h1 span { white-space: nowrap; }
h2 { font-size: clamp(2rem, 3.1vw, 2.85rem); }
.intro-lead { font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.58; max-width: 33ch; margin: 1.35rem 0 1.8rem; }
.intro-facts { margin: 0; }
.intro-facts div { display: grid; grid-template-columns: 8.25rem minmax(0, 1fr); align-items: baseline; gap: 1rem; padding-block: 1rem; border-top: 1px solid var(--brand-gold); }
.intro-facts dt { font-size: 1.02rem; font-weight: 700; color: var(--brand-gold); }
.intro-facts dd { font-size: .95rem; line-height: 1.55; margin: 0; }

.workspace { min-width: 0; scroll-margin-top: 1rem; }
.card {
  padding: clamp(1.4rem, 4vw, 3.1rem);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--card-shadow);
}

.muted { color: var(--muted); }
.form-intro { margin: .95rem 0 1.65rem; }

.kind {
  margin: 0 0 1.55rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .3rem;
}

.kind label { position: relative; cursor: pointer; }
.kind input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.kind span { display: block; min-height: 42px; padding: .52rem .2rem; border: 1px solid transparent; border-radius: 8px; text-align: center; color: var(--ink); font-weight: 700; }
.kind input:checked + span { color: var(--button-text); background: var(--button-fill); }
.kind input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.field-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: 1.2rem .95rem; }
.field { min-width: 0; }
.wide { grid-column: 1 / -1; }
.field label, .optional summary { display: block; font-weight: 700; margin-bottom: .45rem; font-size: .94rem; }
.field input, .optional textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: .6rem .7rem;
  border: 1px solid var(--field-border);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
}

.field [aria-invalid='true'] { border-color: var(--error); }
.field-error { margin: .35rem 0 0; font-size: .875rem; color: var(--error); }
.field-hint { margin: .4rem 0 0; font-size: .875rem; color: var(--muted); }
.optional { margin: 1.5rem 0; border-block: 1px solid var(--border); padding: .78rem 0; }
.optional summary { display: list-item; color: var(--ink); margin: 0; }
.optional summary span { font-size: .8rem; font-weight: 400; color: var(--muted); margin-left: .3rem; }
.optional textarea { margin-top: .7rem; resize: vertical; }
.terms { margin-bottom: 1.2rem; }
.terms-line { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: .65rem; align-items: start; }
.terms-line input { margin: .12rem 0 0; width: 1.25rem; height: 1.25rem; min-height: 0; accent-color: var(--button-fill); }
.terms-line label { color: var(--muted); font-size: .875rem; font-weight: 400; margin: 0; }
.terms-line a, .form-legal a { font-weight: 700; color: var(--accent-link); text-decoration: underline; text-underline-offset: .15em; }
.notice a { font-weight: 700; text-decoration: underline; text-underline-offset: .15em; }
.terms-line a:hover, .form-legal a:hover, .notice a:hover { color: var(--ink); background: var(--hover); border-radius: .15em; }
.security { margin-bottom: .6rem; min-width: 0; }

.button {
  padding: .65rem 1rem;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.primary { color: var(--button-text); background: var(--button-fill); }
.primary:hover { background: var(--button-hover); }
.secondary { color: var(--ink); background: transparent; border-color: var(--field-border); }
.secondary:hover { background: var(--hover); }
.button:disabled { opacity: .76; cursor: wait; }
.request-button { width: 100%; }
.form-legal { color: var(--muted); margin: 1rem 0 0; font-size: .875rem; }

.notice { padding: .72rem .85rem; border-radius: .6rem; margin: 0 0 .85rem; }
.error { background: var(--error-fill); color: var(--error-text); border: 1px solid var(--error-border); }
.status-card { min-height: 25rem; }
#status-link-form { display: grid; gap: .85rem; margin: 1rem 0; max-width: 26rem; }
#status-link-form [type='submit'] { justify-self: start; }
.status-mark { display: block; width: 2.8rem; height: 2.8rem; background: var(--status-fill); color: var(--focus); border-radius: 50%; margin-bottom: 1rem; position: relative; }
.status-mark::after { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); content: '•'; font-size: 1.5rem; font-weight: 700; }
.status-mark[data-kind='mail']::after { content: '✉'; }
.status-mark[data-kind='confirmed']::after { content: '✓'; }
.status-mark[data-kind='attention']::after { content: '!'; }
.status-copy { margin: 1rem 0 1.4rem; font-size: 1.08rem; white-space: pre-line; }
.datum { padding: .7rem 1rem; border-left: 3px solid var(--brand-gold); background: var(--status-fill); margin-bottom: 1.35rem; border-radius: 0 8px 8px 0; }
.datum span { display: block; color: var(--muted); font-size: .875rem; }
.datum strong { display: block; font-size: 1.07rem; }
.actions { display: flex; gap: .7rem; align-items: flex-start; flex-wrap: wrap; }
.action-group { display: flex; gap: .5rem .9rem; flex-wrap: wrap; flex-basis: 100%; margin-top: .6rem; }
.quiet { display: inline-block; color: var(--ink); font-weight: 700; font-size: .93rem; }
.quiet:hover { color: var(--accent-link); text-decoration: underline; text-underline-offset: .15em; }
button.quiet { background: transparent; border: 0; padding: .45rem 0; }
.support { margin-top: 1.3rem; }
.recovery-nav { display: flex; flex-wrap: wrap; gap: .25rem .65rem; margin-top: .65rem; }
.recovery-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem .65rem; border-radius: .5rem; }
.recovery-nav a:hover { background: var(--hover); }
.recovery-nav:not(:has(a:not([hidden]))), body[data-flow='status'] .recovery-nav { display: none; }

.site-footer {
  margin-top: clamp(1.75rem, 4vw, 3rem);
  color: var(--ink);
  background: var(--paper);
  border-top: 1px solid var(--brand-gold);
}

.footer-inner {
  width: min(calc(100% - 64px), 1200px);
  margin-inline: auto;
  padding-block: 2.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(.8rem, 2vw, 1.6rem);
  align-items: center;
}

.footer-brand strong { font-size: 1rem; letter-spacing: .22em; }
.footer-signature { justify-self: center; }
.footer-powered { display: flex; flex-direction: column; gap: .45rem; align-items: center; padding: .35rem .8rem; font-size: .8rem; text-align: center; border-radius: 1rem; }
.footer-powered img { width: 2.25rem; height: 2.25rem; border-radius: 50%; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .3rem; justify-content: flex-end; }
.footer-links a { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .45rem .55rem; border-radius: 999px; font-size: .78rem; }
.site-footer a:hover { color: var(--accent-link); background: var(--hover); text-decoration: underline; text-underline-offset: .15em; }

@media (max-width: 980px) {
  .intro-facts div { grid-template-columns: 1fr; gap: .25rem; }
}

@media (max-width: 800px) {
  .demo { grid-template-columns: minmax(0, 1fr); gap: 1.15rem; margin-top: .4rem; }
  .header { padding-block: .85rem; }
  .header nav { justify-content: flex-end; }
  .intro { min-height: 0; border-radius: 20px; background-image: none; }
  .intro-content { padding: clamp(1.25rem, 5.5vw, 1.65rem); }
  .intro h1 { font-size: clamp(2rem, 8.3vw, 2.55rem); }
  .intro-lead { margin-block: .85rem 1.1rem; }
  .intro-facts div { padding-block: .68rem; gap: .2rem; }
  .intro-facts dd { font-size: .9rem; }
  .card { border-radius: 20px; }
  .status-card { min-height: 0; }
  body[data-flow='status'] .intro { display: none; }
  .footer-inner { width: min(calc(100% - 36px), 1200px); grid-template-columns: 1fr; gap: 1rem; padding-block: 1.75rem; text-align: center; }
  .footer-brand { display: none; }
  .footer-links { justify-content: center; }
}

@media (max-width: 440px) {
  .field-grid { grid-template-columns: 1fr; }
  .header nav a { font-size: .82rem; }
}
