/* ============================================
   BM Property Partners — Reservierungsformular
   Design System v2.0
   ============================================ */

@font-face {
  font-family: 'PolySans';
  src: url('/fonts/PolySans-Neutral.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand Primary */
  --navy:  #051D3F;
  --blue:  #094AF5;
  --blue-dark: #0A3FCE;

  /* Warme Hintergründe */
  --cream: #F8F5EE;
  --beige: #F0EDE6;

  /* Grau-Palette */
  --gray-800: #1F2937;
  --gray-600: #4B5563;
  --gray-400: #9CA3AF;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;

  /* Funktional */
  --green:       #059669;
  --green-light: #ECFDF5;
  --red:         #DC2626;
  --red-light:   #FEF2F2;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(5, 29, 63, 0.04);
  --shadow-md: 0 4px 12px rgba(5, 29, 63, 0.06);
  --shadow-lg: 0 12px 32px rgba(5, 29, 63, 0.08);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'PolySans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-weight: 400;
  color: var(--navy);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== HEADER ===== */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo {
  height: 28px;
  width: auto;
}

.logo-small {
  height: 22px;
  width: auto;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.topbar-meta-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-light);
}

/* ===== PROGRESS ===== */
.progress-wrap {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 0 24px;
}

.progress-track {
  height: 4px;
  background: var(--gray-100);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gray-400);
}

.progress-meta span:last-child {
  color: var(--blue);
}

/* ===== MAIN / STEPS ===== */
.main {
  padding: 56px 24px 96px;
}

.step {
  animation: fadeIn 0.4s ease;
}

.step.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-head {
  margin-bottom: 40px;
}

.overline {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--blue);
  margin-bottom: 16px;
}

.h1 {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 16px;
  font-weight: 400;
}

.h1 .accent {
  color: var(--blue);
}

.h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0;
  font-weight: 400;
}

.sub-h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--blue);
  margin: 16px 0 0;
}

.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--gray-600);
  margin: 0;
  max-width: 640px;
}

/* ===== CARD ===== */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: var(--navy);
  color: #fff;
}

.badge-light {
  background: var(--beige);
  color: var(--navy);
}

/* ===== FORM ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.field { display: flex; flex-direction: column; }
.field-half { grid-column: span 3; }
.field-1-3 { grid-column: span 2; }
.field-2-3 { grid-column: span 4; }
.field-full { grid-column: span 6; }

@media (max-width: 640px) {
  .field-half, .field-1-3, .field-2-3 { grid-column: span 6; }
  .h1 { font-size: 30px; }
  .card { padding: 24px 20px; }
  .main { padding: 32px 16px 64px; }
  .container { padding: 0 16px; }
}

.label {
  font-size: 13px;
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 8px;
}

.input {
  font-family: inherit;
  font-size: 15px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:hover {
  border-color: var(--gray-400);
}

.input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(9, 74, 245, 0.12);
}

.input.error {
  border-color: var(--red);
  background: var(--red-light);
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23051D3F' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  padding-right: 36px;
  cursor: pointer;
}

.hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 6px;
  line-height: 1.5;
}

.hint-text {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.6;
}

.input-with-suffix {
  position: relative;
}

.input-with-suffix .suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--gray-400);
  pointer-events: none;
}

.input-with-suffix .input {
  padding-right: 64px;
}

/* ===== RADIO ===== */
.radio-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-row.stacked {
  flex-direction: column;
  gap: 12px;
}

.radio {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  color: var(--navy);
  transition: border-color 0.15s, background 0.15s;
  flex: 1;
  min-width: 100px;
}

.radio-row.stacked .radio {
  flex: 1;
  min-width: 100%;
}

.radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--gray-400);
  border-radius: 50%;
  margin: 0;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s;
  margin-top: 1px;
}

.radio input[type="radio"]:checked {
  border-color: var(--blue);
  border-width: 5px;
}

.radio:hover {
  border-color: var(--gray-400);
}

.radio:has(input:checked) {
  border-color: var(--blue);
  background: rgba(9, 74, 245, 0.04);
}

.radio span {
  line-height: 1.5;
}

/* ===== CHECKBOX ===== */
.checkbox-inline,
.checkbox-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--navy);
  line-height: 1.5;
}

.checkbox-block {
  padding: 16px;
  background: var(--cream);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.checkbox-inline input[type="checkbox"],
.checkbox-block input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--gray-400);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  background: #fff;
  margin: 0;
  margin-top: 1px;
}

.checkbox-inline input[type="checkbox"]:checked,
.checkbox-block input[type="checkbox"]:checked {
  background: var(--blue);
  border-color: var(--blue);
}

.checkbox-inline input[type="checkbox"]:checked::after,
.checkbox-block input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-inline {
  margin-top: 12px;
}

/* ===== TOGGLE ===== */
.toggle-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  background: var(--gray-300);
  border-radius: 9999px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-track {
  background: var(--blue);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 15px;
  color: var(--navy);
}

.conditional {
  margin-top: 12px;
}

/* ===== SIGNATURE PAD ===== */
.signature-wrap {
  position: relative;
  background: var(--cream);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.signature-pad {
  display: block;
  width: 100%;
  height: 220px;
  cursor: crosshair;
  background: var(--cream);
  touch-action: none;
}

.signature-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 11px;
  color: var(--gray-600);
  padding: 6px 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: border-color 0.15s;
}

.signature-clear:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* ===== LEGAL ===== */
.legal-card {
  padding: 40px;
}

.legal-section + .legal-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--gray-200);
}

.legal-h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--blue);
  margin: 0 0 16px;
  font-weight: 400;
}

.legal-card p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-600);
  margin: 0 0 12px;
}

.legal-card p.emphasis {
  background: rgba(9, 74, 245, 0.06);
  padding: 16px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--blue);
  color: var(--navy);
}

.legal-card ol {
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-600);
  margin: 0 0 12px;
}

.legal-card ol li { margin-bottom: 6px; }

.info-box {
  margin-top: 20px;
  background: var(--beige);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.info-box-h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--blue);
  margin: 0 0 12px;
  font-weight: 400;
}

.kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.kv-table th {
  text-align: left;
  color: var(--gray-600);
  font-weight: 400;
  padding: 4px 16px 4px 0;
  vertical-align: top;
  width: 40%;
}

.kv-table td {
  color: var(--navy);
  padding: 4px 0;
}

/* ===== REVIEW ===== */
.review-card {
  padding: 0;
  overflow: hidden;
}

.review-section {
  padding: 28px 32px;
  border-bottom: 1px solid var(--gray-200);
}

.review-section:last-child { border-bottom: none; }

.review-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.review-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--blue);
  margin: 0;
  font-weight: 400;
}

.review-edit-btn {
  font-size: 12px;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
}

.review-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 6px 0;
  font-size: 14px;
}

.review-row dt {
  color: var(--gray-600);
}

.review-row dd {
  color: var(--navy);
  margin: 0;
}

.review-row dd.empty {
  color: var(--gray-400);
  font-style: italic;
}

@media (max-width: 640px) {
  .review-row { grid-template-columns: 1fr; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--gray-100); }
  .review-section { padding: 24px 20px; }
}

.review-signature-img {
  max-width: 280px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--cream);
  padding: 8px;
}

/* ===== BUTTONS ===== */
.step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.step-actions-meta {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-right: auto;
}

.submit-actions {
  justify-content: space-between;
}

.btn {
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
}

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

.btn-primary:hover {
  background: var(--blue-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.btn-ghost:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.btn-large {
  padding: 18px 32px;
  font-size: 15px;
}

.btn-arrow, .btn-arrow-left {
  font-size: 18px;
  line-height: 1;
}

.submit-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--gray-400);
  text-align: right;
  line-height: 1.6;
}

/* ===== SUCCESS ===== */
.success-block {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 64px 48px;
  text-align: center;
  border: 1px solid var(--gray-200);
}

.success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.next-steps {
  margin-top: 56px;
  padding-top: 48px;
  border-top: 1px solid var(--gray-200);
}

.next-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: left;
}

@media (max-width: 720px) {
  .next-steps-grid { grid-template-columns: 1fr; }
  .success-block { padding: 40px 24px; }
}

.next-step {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.next-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  margin-bottom: 16px;
}

.next-step h4 {
  font-size: 16px;
  color: var(--navy);
  margin: 0 0 8px;
  font-weight: 400;
}

.next-step p {
  font-size: 14px;
  color: var(--gray-600);
  margin: 0;
  line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--navy);
  color: #fff;
  padding: 48px 0;
  margin-top: 64px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-col {
  flex: 1;
  min-width: 200px;
}

.footer-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin: 12px 0 0;
}

.footer-meta a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.footer-legal {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.5);
  margin: 16px 0 0;
}

/* ===== OVERLAY ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 29, 63, 0.6);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 48px 56px;
  text-align: center;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.overlay-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--gray-100);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.overlay-meta {
  font-size: 13px;
  color: var(--gray-400);
  margin: 12px 0 0;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red-light);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-width: 90vw;
}

.hidden { display: none !important; }
