:root {
  color-scheme: light;
  --ink: #123038;
  --muted: #5c6f73;
  --line: #c8d7d3;
  --surface: #f7faf8;
  --paper: #ffffff;
  --teal: #0b6b73;
  --teal-dark: #084b55;
  --gold: #c99734;
  --coral: #c75f4c;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar h1,
.topbar p {
  margin: 0;
}

.kicker {
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav a {
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.admin-identity {
  max-width: 260px;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toplink,
button {
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.toplink {
  color: #fff;
  padding: 10px 14px;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
  min-height: 520px;
  padding: 72px 0 36px;
}

.hero-copy h2 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-size: clamp(2rem, 7vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.65;
}

.route {
  display: inline-block;
  margin: 0;
  padding: 8px 10px;
  border-left: 5px solid var(--gold);
  background: #fff;
  color: var(--teal-dark);
  font-weight: 800;
}

.route-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.route-panel div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.route-panel div:last-child {
  border-bottom: 0;
}

.route-panel strong {
  font-size: 1.55rem;
}

.route-panel span {
  color: var(--muted);
}

.visitor-hero .hero-copy h2 {
  max-width: 820px;
}

.requirements {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 34px;
}

.terms-preview {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.4fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--gold);
  background: #fff;
}

.terms-preview h2,
.terms-preview p {
  margin: 0;
}

.terms-preview h2 {
  font-size: 1.35rem;
}

.terms-preview p {
  color: var(--muted);
  line-height: 1.55;
}

.terms-preview a {
  justify-self: end;
  border-radius: 6px;
  padding: 10px 12px;
  color: #fff;
  background: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.requirements article {
  min-height: 150px;
  padding: 20px;
  border-top: 4px solid var(--teal);
  background: #fff;
}

.requirements h3 {
  margin: 0 0 8px;
}

.requirements p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.form {
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.document {
  display: grid;
  gap: 18px;
  max-width: 880px;
  padding-top: 42px;
}

.document section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.document h2 {
  margin: 8px 0 14px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.document h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.document p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.admin-shell {
  width: min(1280px, calc(100% - 32px));
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 28px 0;
}

.admin-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-card span,
.admin-row span {
  color: var(--muted);
}

.admin-card strong {
  font-size: 1.5rem;
}

.admin-section {
  margin: 24px 0;
}

.admin-section h2 {
  margin: 0 0 12px;
  font-size: 1.4rem;
}

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.8fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-row.tall {
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.4fr);
}

.admin-row > div {
  display: grid;
  gap: 5px;
}

.inline-review {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) repeat(4, auto) minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-review label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.85rem;
}

.inline-review input[type="checkbox"] {
  min-width: 16px;
  width: 16px;
  height: 16px;
  min-height: 16px;
}

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

.compact-form {
  align-content: start;
  padding: 18px;
}

.compact-form label,
.compact-form .actions {
  grid-column: 1 / -1;
}

.form-heading h2 {
  margin: 4px 0 0;
  font-size: 1.8rem;
}

fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 8px;
  font-weight: 900;
}

label,
.checks,
.confirmations {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.field-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #aabbb8;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.checks,
.confirmations,
.assistant-fields,
label:has(textarea),
.actions {
  grid-column: 1 / -1;
}

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

.total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.camera-box {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.55fr);
  gap: 14px;
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.camera-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 800;
}

.camera-box video {
  width: 100%;
  min-height: 220px;
  border-radius: 8px;
  background: #123038;
  object-fit: cover;
}

.camera-actions {
  display: grid;
  align-content: start;
  gap: 10px;
}

.camera-actions p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.total-box span {
  color: var(--muted);
  font-weight: 800;
}

.total-box strong {
  font-size: 1.45rem;
}

.checks span {
  color: var(--ink);
}

.checks label,
.confirmations label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  font-weight: 650;
}

input[type="checkbox"] {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--teal);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

#status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

#status.ok {
  color: var(--teal-dark);
}

#status.error {
  color: #a63527;
}

button {
  min-height: 48px;
  padding: 0 22px;
  font-size: 1rem;
}

button:disabled {
  opacity: 0.68;
  cursor: progress;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .topnav a {
    text-align: center;
  }

  .admin-identity {
    max-width: none;
    text-align: center;
  }

  .hero,
  .requirements,
  .terms-preview,
  .admin-grid,
  .admin-row,
  .admin-row.tall,
  .inline-review,
  .split-admin,
  .assistant-fields,
  .camera-box,
  fieldset {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 42px;
  }

  .form {
    padding: 18px;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .terms-preview a {
    justify-self: stretch;
    text-align: center;
  }
}
