/* ================================================================
   Digitaler Meldeschein – Gasthaus Schutterblick
   Farbwelt von schutterblick.de:
   Navy #1e213d (Text), Stahlblau #2b5672 (Logo/Akzente),
   Braun #634115 (Flächen/CTAs), Creme #fbedd5 (Hintergründe)
   ================================================================ */
:root {
  --braun: #634115;
  --braun-tief: #4a3010;
  --gold: #c98a2e;
  --creme: #fbedd5;
  --creme-hell: #fdf8f0;
  --papier: #fffdf9;
  --navy: #1e213d;
  --blau: #2b5672;
  --grau: #6b6f85;
  --rand: #e6d9c3;
  --rand-hell: #efe6d4;
  --fehler: #b3261e;
  --gruen: #2e7d32;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --schatten: 0 1px 2px rgba(30, 33, 61, 0.05), 0 4px 16px rgba(99, 65, 21, 0.07);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(circle at 20% -10%, #fdf3e2 0%, transparent 45%),
    var(--creme-hell);
  color: var(--navy);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

/* ---------------- Header (hell, wie die Website) ---------------- */
.site-header {
  background: rgba(253, 248, 240, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--navy);
  padding-top: env(safe-area-inset-top);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--rand);
  box-shadow: 0 1px 10px rgba(30, 33, 61, 0.07);
}
.header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.brand-logo { width: 46px; height: 46px; flex-shrink: 0; }
.brand-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.14rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blau);
}
.lang-toggle {
  background: transparent;
  border: 1.5px solid var(--blau);
  color: var(--blau);
  border-radius: 999px;
  padding: 0.38rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.lang-toggle:hover, .lang-toggle:active { background: var(--blau); color: #fff; }

/* ---------------- Layout ---------------- */
.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
  flex: 1;
}

.hero {
  text-align: center;
  padding: 1.9rem 0.5rem 1.5rem;
}
.hero h1 {
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.hero p {
  margin: 0 auto;
  max-width: 30rem;
  color: var(--grau);
  font-size: 0.97rem;
}

/* ---------------- Cards ---------------- */
.card {
  background: var(--papier);
  border: 1px solid var(--rand);
  border-radius: 16px;
  padding: 1.35rem 1.15rem 1.45rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--schatten);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rand-hell);
}
.card-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.step {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blau);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15);
}

/* Zwischenüberschrift mit Linie */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.4rem 0 1rem;
  color: var(--blau);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.divider::before, .divider::after {
  content: "";
  height: 1px;
  background: var(--rand);
  flex: 1;
}

/* ---------------- Formularfelder ---------------- */
.field { margin-bottom: 0.95rem; }
.field:last-child { margin-bottom: 0; }
.field label, .field .label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.field label small { font-weight: 400; color: var(--grau); }

input[type="text"],
input[type="date"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 0.72rem 0.8rem;
  font-size: 1rem;
  font-family: var(--sans);
  border: 1px solid var(--rand);
  border-radius: 11px;
  background: #fff;
  color: var(--navy);
  min-height: 50px;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: inset 0 1px 2px rgba(30, 33, 61, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
select {
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%232b5672' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  cursor: pointer;
}
input::placeholder { color: #b4ac9c; }
input:focus, select:focus {
  outline: none;
  border-color: var(--blau);
  box-shadow: 0 0 0 3.5px rgba(43, 86, 114, 0.16);
}
input.invalid, select.invalid { border-color: var(--fehler); background-color: #fdf4f3; }
input[type="date"] { min-width: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.grid-street { display: grid; grid-template-columns: 1fr 84px; gap: 0.8rem; }
.grid-plz { display: grid; grid-template-columns: 116px 1fr; gap: 0.8rem; }
@media (max-width: 370px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Personenanzahl – Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: 11px;
  padding: 5px;
  max-width: 220px;
}
.stepper button {
  width: 48px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--creme);
  color: var(--braun);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.stepper button:hover { background: var(--rand-hell); }
.stepper button:active { background: var(--rand); }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper span {
  flex: 1;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--navy);
}

/* Anrede – Segmented Control */
.segmented {
  display: flex;
  background: var(--creme-hell);
  border: 1px solid var(--rand);
  border-radius: 11px;
  padding: 4px;
  gap: 4px;
}
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  font-size: 0.95rem;
  border-radius: 8px;
  color: var(--grau);
  cursor: pointer;
  transition: all 0.15s;
}
.segmented input:checked + span {
  background: var(--blau);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(30, 33, 61, 0.3);
}
.segmented input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 1px; }

/* Checkbox */
.checkbox {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--navy);
}
.checkbox input {
  width: 22px;
  height: 22px;
  margin-top: 0.05rem;
  accent-color: var(--blau);
  flex-shrink: 0;
}

.required-hint { font-size: 0.78rem; color: var(--grau); margin: 0.8rem 0 0; }

/* ---------------- Begleitpersonen ---------------- */
.hint { font-size: 0.86rem; color: var(--grau); margin: -0.35rem 0 1rem; }
.begleit {
  border: 1px solid var(--rand);
  border-left: 4px solid var(--blau);
  border-radius: 12px;
  padding: 1rem 1rem 1.1rem;
  margin-bottom: 0.9rem;
  background: var(--creme-hell);
}
.begleit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}
.begleit-head strong {
  color: var(--blau);
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
}
.remove-btn {
  background: none;
  border: none;
  color: var(--fehler);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
}
.remove-btn:active { background: rgba(179, 38, 30, 0.08); }
.begleit .segmented { background: #fff; }

/* ---------------- Buttons ---------------- */
.btn-primary {
  width: 100%;
  background: linear-gradient(180deg, #74501e 0%, var(--braun) 60%, var(--braun-tief) 100%);
  color: var(--creme);
  border: none;
  border-radius: 13px;
  min-height: 56px;
  font-size: 1.06rem;
  font-weight: 700;
  font-family: var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  margin-top: 1.1rem;
  box-shadow: 0 3px 10px rgba(74, 48, 16, 0.3), inset 0 1px 0 rgba(255,255,255,0.14);
  transition: transform 0.08s, box-shadow 0.15s, filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 4px rgba(74, 48, 16, 0.3); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.btn-secondary {
  width: 100%;
  background: #fff;
  color: var(--blau);
  border: 1.5px solid var(--blau);
  border-radius: 13px;
  min-height: 52px;
  font-size: 0.98rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover, .btn-secondary:active { background: #eef3f7; }

/* ---------------- Fehler & Erfolg ---------------- */
.error {
  color: var(--fehler);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.8rem;
  background: #fdf1f0;
  border: 1px solid #eecfcc;
  border-radius: 10px;
}
.success { text-align: center; padding: 2.75rem 1.5rem; }
.success-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(180deg, #3d9142, var(--gruen));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.1rem;
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.35);
}
.success h2 {
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.55rem;
  margin: 0 0 0.5rem;
}
.success p { color: var(--grau); max-width: 26rem; margin: 0 auto; }
.success .btn-secondary { margin-top: 1.6rem; }

.gaestekarte { margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--rand-hell); }
.gaestekarte .field { margin-top: 0.85rem; margin-bottom: 0; }

.hidden { display: none !important; }

/* ---------------- Footer (navy, wie Text/Logo der Website) ---------------- */
.site-footer { margin-top: auto; }
.footer-hills { display: block; width: 100%; height: 30px; }
.footer-inner {
  background: var(--navy);
  color: var(--creme);
  text-align: center;
  font-size: 0.82rem;
  padding: 0.9rem 1rem calc(1.4rem + env(safe-area-inset-bottom));
}
.footer-inner p { margin: 0.15rem 0; opacity: 0.8; }
.footer-inner .footer-name {
  font-family: var(--serif);
  font-size: 0.95rem;
  opacity: 1;
  letter-spacing: 0.02em;
}

/* ---------------- Admin ---------------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--rand-hell);
  vertical-align: top;
}
.admin-table th {
  color: var(--blau);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-table a { color: var(--blau); word-break: break-all; }
.qr-box { text-align: center; }
.qr-box img { max-width: 250px; width: 100%; border: 1px solid var(--rand); border-radius: 14px; }
.qr-url { font-size: 0.9rem; color: var(--blau); word-break: break-all; }
.pin-form { display: flex; gap: 0.75rem; }
.pin-form input { flex: 1; }
.pin-form button { width: auto; padding: 0 1.6rem; margin-top: 0; }
.table-wrap { overflow-x: auto; }
