:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #0f0d0b;
  color: #f7f0e7;
  font-synthesis: none;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -10rem, rgba(190, 137, 77, 0.3), transparent 36rem),
    #0f0d0b;
}

.shell {
  width: min(100% - 2rem, 42rem);
  margin: 0 auto;
  padding: max(2rem, env(safe-area-inset-top)) 0 max(4rem, env(safe-area-inset-bottom));
}

.hero {
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: #d6ad76;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(2.15rem, 8vw, 3.25rem);
  letter-spacing: 0.025em;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
  line-height: 1.35;
}

.hero > p:not(.eyebrow),
.completion-guide {
  color: #c8beb2;
  line-height: 1.7;
}

.hero > p:not(.eyebrow) {
  max-width: 34rem;
  margin-bottom: 1.3rem;
}

.hero-description {
  font-size: clamp(0.94rem, 4vw, 1rem);
}

.hero-description span {
  display: block;
  white-space: nowrap;
}

.steps {
  display: flex;
  width: min(100%, 22rem);
  align-items: center;
  margin: 0 auto;
  padding: 0;
  color: #9e9489;
  font-size: 0.75rem;
  font-weight: 700;
  list-style: none;
}

.steps li {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  white-space: nowrap;
}

.steps li:not(:last-child)::after {
  min-width: 0.75rem;
  height: 1px;
  flex: 1 1 auto;
  background: #4b4036;
  content: "";
}

.steps li:last-child {
  flex: 0 0 auto;
}

.steps span {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #594b3e;
  border-radius: 50%;
}

.steps li[aria-current="step"] {
  color: #f7f0e7;
}

.steps li[aria-current="step"] span,
.steps li[data-complete="true"] span {
  border-color: #d8a866;
  background: #d8a866;
  color: #17110b;
}

.card {
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid #39312a;
  border-radius: 1.15rem;
  background: rgba(28, 24, 20, 0.94);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.28);
}

form {
  display: grid;
  gap: 1.35rem;
}

.boot-panel,
.submit-area,
.completion-actions {
  display: grid;
  gap: 0.8rem;
}

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.2rem;
}

.section-kicker {
  margin-bottom: 0.25rem;
  color: #c99b62;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.required-legend {
  margin: 0.18rem 0 0;
  color: #c8beb2;
  font-size: 0.72rem;
  white-space: nowrap;
}

.required-legend span {
  color: #f1bd7e;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.required-badge,
.optional-badge {
  flex: 0 0 auto;
  border-radius: 0.25rem;
  padding: 0.08rem 0.34rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.required-badge {
  background: #5a321f;
  color: #ffd9b1;
}

.optional-badge {
  background: #332e29;
  color: #c8beb2;
}

input,
select,
textarea,
button {
  width: 100%;
  border-radius: 0.65rem;
  font: inherit;
}

input,
select,
textarea {
  min-width: 0;
  max-width: 100%;
  border: 1px solid #51463c;
  background: #14110f;
  color: #fffaf4;
  padding: 0.88rem 0.9rem;
  font-size: 1rem;
}

input,
select {
  height: 3.25rem;
  min-height: 3.25rem;
}

input[type="date"] {
  max-height: 3.25rem;
  -webkit-appearance: none;
  appearance: none;
  padding-inline: 0;
}

input[type="date"]::-webkit-date-and-time-value {
  height: 1.5em;
  padding-inline-start: 0.9rem;
  line-height: 1.5em;
  text-align: left;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  margin-inline-end: 0.9rem;
}

.visit-history-field {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.visit-history-field legend {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.visit-history-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.visit-history-option {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid #51463c;
  border-radius: 0.65rem;
  background: #14110f;
  padding: 0.8rem 0.9rem;
  cursor: pointer;
}

.visit-history-option input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: #d8a866;
}

input::placeholder,
textarea::placeholder {
  color: #8f857a;
  opacity: 1;
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.72;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid #ddb578;
  outline-offset: 2px;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

button {
  border: 0;
  background: #d8a866;
  color: #17110b;
  cursor: pointer;
  min-height: 3.35rem;
  padding: 0.95rem 1rem;
  font-weight: 800;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

#submit-button[data-loading="true"]::before {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.55rem;
  border: 2px solid rgba(23, 17, 11, 0.35);
  border-top-color: #17110b;
  border-radius: 50%;
  vertical-align: -0.12rem;
  content: "";
  animation: spin 0.8s linear infinite;
}

.secondary-button {
  border: 1px solid #66584b;
  background: transparent;
  color: #f7f0e7;
}

.notice {
  border: 1px solid transparent;
  border-radius: 0.65rem;
  background: #25201b;
  color: #d9d0c5;
  padding: 0.9rem 1rem;
  line-height: 1.6;
}

.notice[data-kind="loading"] {
  border-color: #4f4338;
}

.notice[data-kind="success"] {
  border-color: #305f48;
  background: #183327;
  color: #c7f1da;
}

.notice[data-kind="error"] {
  border-color: #794040;
  background: #421f1f;
  color: #ffd4d4;
}

.notice:focus {
  outline: 2px solid #ddb578;
  outline-offset: 2px;
}

.field-help,
.submit-help {
  color: #aaa095;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.55;
}

.guidance {
  display: grid;
  gap: 0.4rem;
  border-left: 3px solid #9d7447;
  background: #211c18;
  padding: 0.85rem 0.95rem;
  color: #c8beb2;
  font-size: 0.78rem;
  line-height: 1.65;
}

.schedule-notice {
  margin: -0.45rem 0 0;
  border: 1px solid #745a35;
  border-radius: 0.65rem;
  background: #342817;
  color: #f3d6a6;
  padding: 0.75rem 0.9rem;
  font-size: 0.8rem;
  line-height: 1.6;
}

.guidance p,
.submit-help {
  margin: 0;
}

.submit-area {
  padding-top: 0.15rem;
}

.submit-help {
  text-align: center;
}

.completion-panel {
  padding: 1.4rem 0 0.3rem;
  text-align: center;
}

.completion-panel:focus {
  outline: none;
}

.completion-mark {
  display: grid;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.2rem;
  place-items: center;
  border: 1px solid #4f8b69;
  border-radius: 50%;
  background: #183327;
  color: #c7f1da;
  font-size: 2rem;
  font-weight: 800;
}

.completion-message {
  margin: 1rem 0 0;
  color: #f7f0e7;
  line-height: 1.7;
}

.completion-guide {
  margin: 0.75rem 0 1.35rem;
  font-size: 0.84rem;
}

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

@media (max-width: 34rem) {
  .shell {
    width: min(100% - 1rem, 42rem);
    padding-top: max(1.25rem, env(safe-area-inset-top));
  }

  .date-time-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .visit-history-options {
    grid-template-columns: 1fr;
  }

  .card {
    border-radius: 0.9rem;
  }
}

@media (max-width: 22rem) {
  .form-heading {
    grid-template-columns: 1fr;
  }

  .form-heading {
    display: grid;
  }

  .required-legend {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #submit-button[data-loading="true"]::before {
    animation: none;
  }
}
