.public-page {
  min-height: 100dvh;
  background: var(--petra-paper);
  color: var(--petra-ink);
}

.public-header {
  position: relative;
  z-index: 20;
  width: 100%;
  border-bottom: 1px solid transparent;
}

.public-header--light {
  border-color: var(--petra-line);
  background: var(--petra-paper);
}

.public-header--overlay {
  position: absolute;
  inset: 0 0 auto;
  color: var(--petra-cream);
}

.public-header__inner {
  display: flex;
  min-height: 4.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.brand {
  flex: 0 0 auto;
  color: var(--petra-forest);
  font-family: var(--petra-serif);
  font-size: clamp(1.7rem, 4vw, 2.05rem);
  letter-spacing: -0.065em;
  line-height: 1;
  text-decoration: none;
}

.brand--light { color: var(--petra-cream); }

.public-nav,
.public-header__actions {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.4rem);
}

.language-switcher {
  --language-active-background: var(--petra-forest);
  --language-active-color: var(--petra-cream);
  display: inline-grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* Each language is a complete touch target, not just a tiny label. */
  min-width: 8.25rem;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: var(--petra-radius);
  color: inherit;
}

.language-switcher button {
  min-width: 2.75rem;
  min-height: 44px;
  border: 0;
  border-inline-end: 1px solid currentColor;
  padding: 0.15rem 0.3rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
}

.language-switcher button:last-child { border-inline-end: 0; }

.language-switcher button[aria-pressed="true"] {
  background: var(--language-active-background);
  color: var(--language-active-color);
}

.language-switcher button:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.language-switcher button[aria-pressed="true"]:hover { background: var(--language-active-background); }

.public-header--overlay .language-switcher,
.stay-header .language-switcher,
.auth-header .language-switcher,
.review-header .language-switcher,
.account-header .language-switcher {
  --language-active-background: var(--petra-cream);
  --language-active-color: var(--petra-forest-dark);
}

.public-nav a,
.header-link,
.compact-menu a,
.mobile-signin {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: inherit;
  font-size: 0.84rem;
  font-weight: 720;
  text-decoration: none;
  text-underline-offset: 0.35rem;
}

.public-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.public-header__mobile-actions { display: none; }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--petra-forest);
  border-radius: var(--petra-radius);
  padding: 0.68rem 1rem;
  background: var(--petra-forest);
  color: var(--petra-cream);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover:not(:disabled) {
  border-color: var(--petra-forest-dark);
  background: var(--petra-forest-dark);
  transform: translateY(-1px);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
}

.button--light {
  border-color: var(--petra-cream);
  background: var(--petra-cream);
  color: var(--petra-forest-dark);
}

.button--light:hover:not(:disabled) {
  border-color: #fff;
  background: #fff;
}

.button--secondary {
  border-color: currentColor;
  background: transparent;
  color: var(--petra-forest);
}

.button--secondary:hover:not(:disabled) {
  background: rgba(27, 59, 43, 0.08);
  color: var(--petra-forest-dark);
}

.button--outline-light {
  border-color: rgba(245, 239, 235, 0.82);
  background: transparent;
  color: var(--petra-cream);
}

.button--outline-light:hover:not(:disabled) {
  border-color: var(--petra-cream);
  background: rgba(245, 239, 235, 0.12);
}

.compact-menu {
  position: relative;
  display: none;
}

.compact-menu summary {
  display: inline-flex;
  width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: var(--petra-radius);
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  list-style: none;
}

.compact-menu summary::-webkit-details-marker { display: none; }

.compact-menu nav {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  display: grid;
  min-width: min(16rem, calc(100vw - 2rem));
  gap: 0.15rem;
  padding: 0.45rem;
  border: 1px solid rgba(245, 239, 235, 0.22);
  background: var(--petra-forest-dark);
  box-shadow: var(--petra-shadow);
}

.compact-menu nav a {
  padding-inline: 0.65rem;
  color: var(--petra-cream);
}

.compact-menu--light nav {
  border-color: var(--petra-line);
  background: var(--petra-paper);
}

.compact-menu--light nav a { color: var(--petra-ink); }

.form-field {
  display: grid;
  min-width: 0;
  min-inline-size: 0;
  gap: 0.45rem;
  color: var(--petra-ink);
  font-size: 0.9rem;
  font-weight: 720;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--petra-line);
  border-radius: var(--petra-radius);
  padding: 0.7rem 0.75rem;
  background: #fff;
  color: var(--petra-ink);
  font-weight: 520;
}

/* Keep the native iOS date picker, but do not let its intrinsic width escape a grid cell. */
.form-field input[type="date"] {
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--petra-forest);
  outline: 2px solid rgba(27, 59, 43, 0.18);
  outline-offset: 0;
}

.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"] {
  border-color: var(--petra-danger);
}

.form-message {
  margin: 0;
  color: var(--petra-danger);
  font-size: 0.9rem;
  font-weight: 650;
}

.form-message[data-state="success"] { color: var(--petra-forest); }

.form-note {
  margin: 0;
  color: var(--petra-stone);
  font-size: 0.88rem;
}

.back-link,
.text-link {
  color: var(--petra-forest);
  font-weight: 730;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25rem;
}

@media (max-width: 47.99rem) {
  .public-nav--desktop,
  .public-header__actions { display: none; }

  .public-header__mobile-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .mobile-signin { padding-inline: 0.4rem; }
  .compact-menu { display: block; }
}

@media (max-width: 25rem) {
  /* 49px brand + 132px language control + 104px account/menu fits a 320px phone. */
  .public-header__inner { gap: 0; }
  .language-switcher { min-width: 8.25rem; }
  .language-switcher button { min-width: 2.75rem; min-height: 44px; padding-inline: 0; font-size: 0.67rem; }
}

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