.form-section {
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}

.section-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.section-description {
  margin: 0 0 16px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-full {
  grid-column: 1 / -1;
}

.field-label {
  font-weight: 600;
  font-size: 0.92rem;
}

.required-mark {
  color: var(--color-danger);
}

.field-help {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.field-control {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.35;
}

/* V1.0.400 — Datum-Inputs (Geburtsdatum, Anreise, Abreise) auf iOS Safari
   werden sonst zentriert dargestellt und wirken kürzer als die anderen
   Felder. Wir zwingen sie explizit auf dieselbe Box + linksbündig. */
input[type="date"].field-control,
input[type="date"] {
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
  display: block;
}

/* iOS: Placeholder-Slot des Date-Inputs linksbündig, sobald kein Wert
   gesetzt ist. */
input[type="date"].field-control::-webkit-date-and-time-value {
  text-align: left;
}

.field-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.field-error .field-control,
.field-error .country-select-trigger {
  border-color: var(--color-danger);
  background: var(--color-danger-bg);
}

.error-text {
  font-size: 0.82rem;
  color: var(--color-danger);
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding-top: 6px;
}

.checkbox-row input {
  margin-top: 4px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.repeater-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.repeater-card {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.repeater-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.repeater-card-title {
  margin: 0;
  font-size: 1rem;
}

.repeater-actions {
  margin-top: 16px;
}

.country-select {
  position: relative;
}

.country-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.country-trigger-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.country-trigger-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.country-select-menu {
  position: absolute;
  inset: calc(100% + 8px) 0 auto 0;
  display: none;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  z-index: 20;
}

.country-select-menu.open {
  display: block;
}

.country-option {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.country-option:hover {
  background: var(--color-surface-muted);
}

.country-flag {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.country-option-label {
  min-width: 0;
}

.country-option-code {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* UI-A4: 700 → 768 (Mobile) */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .repeater-card-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================= */
/* PERSON SUBSECTIONS / GRID UX */
/* ============================= */
.person-subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.person-subsection:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.person-subsection-title {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
}

.field-spacer {
  display: block;
}

.repeater-card .form-grid {
  align-items: start;
}

/* UI-A4: 700 → 768 (Mobile) */
@media (max-width: 768px) {
  .field-spacer {
    display: none;
  }
}

/* ============================= */
/* PHONE INPUT WITH COUNTRY CODE */
/* ============================= */
.phone-input {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.phone-input:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.phone-country-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 118px;
  padding: 0 12px;
  border: none;
  border-right: 1px solid var(--color-border);
  border-radius: 14px 0 0 14px;
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
}

.phone-flag,
.phone-option-flag {
  display: inline-flex;
  width: 22px;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.phone-dial-code {
  font-weight: 600;
  white-space: nowrap;
}

.phone-caret {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.phone-local-input {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: none;
  border-radius: 0 14px 14px 0;
  background: transparent;
  font: inherit;
}

.phone-local-input:focus {
  outline: none;
}

.phone-country-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: none;
  width: min(420px, 100%);
  max-height: 320px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.phone-country-menu.open {
  display: block;
}

.phone-country-search {
  width: 100%;
  margin-bottom: 8px;
  padding: 11px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font: inherit;
}

.phone-country-search:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.phone-country-list {
  max-height: 246px;
  overflow: auto;
}

.phone-country-option {
  width: 100%;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.phone-country-option:hover {
  background: var(--color-surface-muted);
}

.phone-option-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-option-dial {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.field-error .phone-input {
  border-color: var(--color-danger);
  background: var(--color-danger-bg);
}

/* UI-A4: 700 → 768 (Mobile) */
@media (max-width: 768px) {
  .phone-input {
    flex-direction: column;
  }

  .phone-country-trigger {
    width: 100%;
    min-height: 44px;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 14px 14px 0 0;
  }

  .phone-local-input {
    border-radius: 0 0 14px 14px;
  }

  .phone-country-menu {
    width: 100%;
  }
}

/* ============================= */
/* LIVE VALIDATION EXTENSIONS */
/* ============================= */
.field-error .phone-input-wrapper,
.field-error .country-select-trigger,
.field-error .field-control,
.field-error input,
.field-error select,
.field-error textarea {
  border-color: var(--color-danger, #dc2626) !important;
  background: var(--color-danger-bg, #fef2f2) !important;
}

.field-error .phone-input-wrapper:focus-within,
.field-error .country-select-trigger:focus-within,
.field-error .field-control:focus,
.field-error input:focus,
.field-error select:focus,
.field-error textarea:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14) !important;
}

.error-text {
  margin-top: 6px;
  color: var(--color-danger, #dc2626);
  font-size: 12px;
  font-weight: 700;
}

/* Cosmos Check-in: locked primary guest after completed check-in */
.repeater-card-locked {
  border-color: #bbf7d0;
  background: #f8fffb;
}

.lock-notice {
  margin: 0 0 14px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid #bbf7d0;
  background: #ecfdf3;
  color: #067647;
  font-size: 0.88rem;
  line-height: 1.45;
  font-weight: 650;
}

.field-locked input,
.field-locked select,
.field-locked textarea,
.field-locked button {
  opacity: 0.72;
  cursor: not-allowed;
}

/* Check-in UX hardening: Pflichtfelder, Readonly-Zimmer, E-Mail-Warnung */
.field-readonly .field-control,
.field-control-readonly {
  background: #f3f4f6;
  color: #4b5563;
  cursor: not-allowed;
}

.field-error .field-control,
.field-error .country-select-trigger {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25);
}

.email-reachability-warning {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.86rem;
}

.email-reachability-warning .email-warning-text {
  margin-bottom: 8px;
}

.email-override-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid #f59e0b;
  background: #fff;
  color: #92400e;
  font-weight: 700;
  cursor: pointer;
}

.checkbox-row a {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: underline;
}

/* Check-in UX: Adressuebernahme + Entfernen-Dialog */
.address-copy-panel {
  margin: 6px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--color-border, #d8dee6);
  border-radius: 12px;
  background: var(--color-surface-muted, #f8fafc);
}

.address-copy-label {
  display: block;
  margin-bottom: 7px;
  color: var(--color-text-muted, #667085);
  font-size: 12px;
  font-weight: 700;
}

.address-copy-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.address-copy-select {
  flex: 1 1 220px;
  min-height: 38px;
  border: 1px solid var(--color-border, #d8dee6);
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
}

.address-copy-button {
  min-height: 38px;
}

.modal-backdrop.guest-remove-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
}

.guest-remove-modal {
  width: min(520px, 100%);
  padding: 24px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

.guest-remove-modal h3 {
  margin: 0 0 8px;
  color: var(--color-text, #111827);
}

.guest-remove-modal p {
  margin: 0 0 16px;
  color: var(--color-text-muted, #667085);
}

.remove-reason-option {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border, #d8dee6);
  border-radius: 12px;
  cursor: pointer;
}

.remove-reason-text {
  width: 100%;
  min-height: 84px;
  margin-top: 10px;
  border: 1px solid var(--color-border, #d8dee6);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.field-error-border {
  border-color: var(--color-danger, #dc2626) !important;
}

.guest-remove-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 640px) {
  .modal-backdrop.guest-remove-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .guest-remove-modal {
    border-radius: 20px 20px 0 0;
  }

  .guest-remove-actions {
    flex-direction: column-reverse;
  }

  .guest-remove-actions button {
    width: 100%;
    justify-content: center;
  }
}

/* Check-in UX step3: inline address copy button + aligned personal fields */
.person-subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.person-subsection-header .person-subsection-title {
  margin: 0;
}

.address-copy-mini-button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.field-help {
  min-height: 1em;
  line-height: 1.25;
}

.modal-backdrop.address-copy-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
}

.address-copy-modal {
  width: min(500px, 100%);
  padding: 24px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

.address-copy-modal h3 {
  margin: 0 0 8px;
  color: var(--color-text, #111827);
}

.address-copy-modal p {
  margin: 0 0 16px;
  color: var(--color-text-muted, #667085);
  line-height: 1.45;
}

.address-copy-source-list {
  display: grid;
  gap: 8px;
}

.address-copy-source {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--color-border, #d8dee6);
  border-radius: 12px;
  background: #fff;
  color: var(--color-text, #111827);
  text-align: left;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.address-copy-source:hover,
.address-copy-source:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.address-copy-empty {
  padding: 12px 13px;
  border: 1px dashed var(--color-border, #d8dee6);
  border-radius: 12px;
  background: var(--color-surface-muted, #f8fafc);
  color: var(--color-text-muted, #667085);
  font-size: 0.9rem;
  line-height: 1.45;
}

.address-copy-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

@media (max-width: 640px) {
  .person-subsection-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .address-copy-mini-button {
    width: auto;
  }

  .modal-backdrop.address-copy-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .address-copy-modal {
    border-radius: 20px 20px 0 0;
  }
}


/* Check-in UX step4: booking notice, readonly booking fields and compact action buttons */
.form-info-notice {
  margin: -10px 0 28px;
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-left: 4px solid var(--color-primary, #2563eb);
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--color-text, #111827);
  font-size: 0.92rem;
  line-height: 1.55;
}

.field-readonly .field-control,
.field-control-readonly {
  background: #f1f5f9;
  color: #475569;
  cursor: not-allowed;
}

.address-copy-mini-button,
.repeater-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.address-copy-mini-button {
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.10);
  color: var(--color-primary, #2563eb);
}

.address-copy-mini-button:hover,
.address-copy-mini-button:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.16);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.repeater-remove-btn {
  border: 1px solid rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.07);
  color: var(--color-danger, #b42318);
}

.repeater-remove-btn:hover,
.repeater-remove-btn:focus {
  outline: none;
  border-color: var(--color-danger, #b42318);
  background: rgba(180, 35, 24, 0.12);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}

@media (max-width: 640px) {
  .form-info-notice {
    margin-top: -8px;
  }

  .repeater-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .repeater-remove-btn {
    width: auto;
  }
}
