:root {
  --page-bg: #f6f6f6;
  --ink: rgba(45, 2, 2, 0.65);
  --body-ink: rgba(0, 0, 0, 0.85);
  --link-blue: rgb(0, 0, 238);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--page-bg);
  color: var(--body-ink);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.2;
}

a {
  color: inherit;
}

.admin-body a {
  text-decoration: none;
}

.splash {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background-image: url("assets/background.jpeg");
  background-position: center;
  background-size: cover;
}

.splash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(246, 246, 246, 0.03);
  pointer-events: none;
}

.splash-nav {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.nav-link {
  position: absolute;
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1;
  text-decoration: none;
}

.nav-link:active,
.stamp-link:active {
  opacity: 0.7;
}

.nav-portfolio {
  top: calc(10rem + 5rem);
  left: calc(20rem + 5rem);
}

.nav-gallery {
  top: calc(10rem + 5rem);
  right: calc(20rem + 5rem);
}

.nav-booking {
  bottom: calc(10rem + 5rem);
  left: calc(20rem + 5rem);
}

.nav-faq {
  right: calc(23rem + 5rem);
  bottom: calc(10rem + 5rem);
}

.stamp-link {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  display: block;
  width: 9rem;
  height: 9rem;
  transform: translate(-50%, -50%);
  opacity: 0.45;
}

.stamp-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.content-page {
  min-height: 100svh;
  background: var(--page-bg);
}

.copy-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: start;
  padding: 1.5rem;
}

.copy {
  max-width: 960px;
}

.copy p {
  margin: 0 0 1.2em;
}

.copy a {
  color: var(--link-blue);
}

.signature {
  display: block;
  width: 5.1%;
  min-width: 42px;
  max-width: 72px;
  height: auto;
}

.back-link {
  color: var(--body-ink);
  text-decoration: none;
  white-space: nowrap;
}

.center-page {
  position: relative;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.corner-back {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

.wip {
  margin: 0;
}

.form-page {
  min-height: 100svh;
  background-color: #f3f3fe;
  background-image: url("assets/background.jpeg");
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}

.booking-shell {
  padding: 32px 16px;
}

.booking-form {
  width: min(100%, 750px);
  margin: 0 auto;
  padding: 32px;
  background: #ebebeb;
  color: #2c3344;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
}

.booking-header {
  text-align: center;
  margin-bottom: 28px;
}

.booking-header img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 20px;
}

.booking-header h1,
.admin-shell h1 {
  margin: 0 0 8px;
  color: #2c3344;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0;
  line-height: 1.2;
}

.booking-header p,
.notice p {
  margin: 0 0 12px;
}

.notice {
  margin-bottom: 24px;
}

.center {
  text-align: center;
}

.indent {
  padding-left: 48px;
}

.booking-form label,
.booking-form fieldset,
.admin-panel label {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  font-weight: 700;
}

.booking-form fieldset {
  padding: 0;
  border: 0;
}

.booking-form legend {
  margin-bottom: 8px;
  font-weight: 700;
}

.booking-form input[type="text"],
.booking-form input[type="email"],
.booking-form input[type="file"],
.admin-panel input,
.admin-panel select,
.admin-panel textarea {
  width: min(100%, 310px);
  min-height: 40px;
  border: 1px solid rgba(44, 51, 68, 0.25);
  border-radius: 0;
  background: #fff;
  color: #2c3344;
  font: inherit;
  font-weight: 400;
  padding: 8px 10px;
}

.admin-panel textarea {
  width: 100%;
  min-height: 160px;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-switcher {
  display: flex;
  gap: 8px;
}

.settings-switch {
  min-height: 40px;
  border: 1px solid rgba(44, 51, 68, 0.25);
  background: #fff;
  color: #2c3344;
  cursor: pointer;
  font: inherit;
  padding: 8px 16px;
}

.settings-switch.is-active {
  background: #2c3344;
  color: #fff;
}

.settings-view {
  display: none;
}

.settings-view.is-active {
  display: grid;
  gap: 18px;
}

.settings-section {
  display: grid;
  gap: 16px;
}

.page-dropdown summary {
  cursor: pointer;
  color: #2c3344;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.page-dropdown[open] summary {
  margin-bottom: 16px;
}

.settings-section h2 {
  margin: 0;
  color: #2c3344;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.settings-form label {
  margin: 0;
}

.settings-form input,
.settings-form textarea {
  width: 100%;
}

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

.field-builder {
  display: grid;
  gap: 14px;
}

.field-editor {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

.inline-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.inline-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.preview-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-preview {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
}

.field-preview {
  display: grid;
  gap: 10px;
}

.field-preview fieldset {
  padding: 0;
  border: 0;
}

.page-preview h3,
.page-preview p {
  margin: 0;
}

.field-preview input,
.field-preview textarea {
  opacity: 0.65;
}

.section-edit-box,
.field-edit-box {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 100;
  display: grid;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
}

.section-edit-box[hidden],
.field-edit-box[hidden] {
  display: none;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h3 {
  margin: 0;
}

body.modal-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.28);
}

.field-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-editor-head p,
.field-note {
  margin: 4px 0 0;
  color: rgba(0, 0, 0, 0.62);
  font-size: 0.9rem;
}

.field-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr) auto;
  gap: 12px;
  align-items: end;
}

.field-options-editor {
  display: none;
}

.field-options-editor.is-visible {
  display: grid;
}

.add-field-button {
  width: fit-content;
}

.field-move-controls {
  display: flex;
  gap: 8px;
}

.inline-check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.settings-save {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.option-list {
  display: grid;
  gap: 8px;
}

.option-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin: 0;
  font-weight: 400;
}

.option-list input {
  margin: 0.15em 0 0;
}

.sub-label {
  color: #464d5e;
  font-size: 0.85rem;
  font-weight: 400;
}

.booking-form button,
.admin-panel button,
.admin-topbar button {
  width: fit-content;
  min-height: 40px;
  border: 1px solid rgba(44, 51, 68, 0.35);
  background: #fff;
  color: #2c3344;
  cursor: pointer;
  font: inherit;
  padding: 8px 18px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.faq-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.admin-body {
  background: #f4f4f4;
}

.admin-shell {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 32px 0;
}

.admin-login {
  display: grid;
  min-height: 100svh;
  place-items: center;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-topbar nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-date,
.detail-pronouns {
  color: rgba(0, 0, 0, 0.58);
  font-weight: 400;
}

.admin-panel {
  overflow-x: auto;
  padding: 20px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.admin-filters label {
  margin: 0;
}

.admin-filters input,
.admin-filters select {
  width: 100%;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}

.filter-summary {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(0, 0, 0, 0.65);
}

.admin-error {
  color: #9b1c1c;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  text-align: left;
}

.admin-table .received-cell {
  text-align: right;
}

.header-filter {
  position: relative;
  display: inline-block;
}

.header-filter summary {
  cursor: pointer;
  list-style: none;
}

.header-filter summary::-webkit-details-marker {
  display: none;
}

.header-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  display: grid;
  min-width: 190px;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.header-filter-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.header-filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.sort-link {
  display: inline-block;
}

.submission-link-cell a {
  display: block;
  margin: -10px;
  padding: 10px;
}

.admin-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
}

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

.detail-field {
  display: grid;
  gap: 6px;
}

.detail-field dt {
  font-weight: 700;
}

.detail-field dd {
  margin: 0;
}

.detail-wide {
  grid-column: 1 / -1;
}

.file-list {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 900px) {
  .splash {
    background-position: 27% 73%;
  }

  .nav-link {
    font-size: 1.4rem;
  }

  .nav-portfolio {
    top: 15rem;
    left: 1.5rem;
  }

  .nav-gallery {
    top: 20rem;
    right: auto;
    left: 1.5rem;
  }

  .nav-booking {
    right: 1.5rem;
    bottom: 15rem;
    left: auto;
  }

  .nav-faq {
    right: 1.5rem;
    bottom: 20rem;
  }

  .stamp-link {
    width: 8rem;
    height: 8rem;
  }

  .copy-block {
    grid-template-columns: 1fr;
  }

  .back-link {
    justify-self: end;
    order: -1;
  }

  .booking-form {
    padding: 22px;
  }

  .admin-topbar,
  .admin-detail,
  .detail-grid,
  .admin-filters,
  .option-editor-grid,
  .field-editor-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
}
