*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: #2a241c;
  background: #fff;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.back-btn {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2a241c;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.back-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.back-btn:hover {
  color: #3a6ea5;
}

.logo {
  justify-self: center;
  line-height: 0;
}

.logo img {
  display: block;
  height: 56px;
  width: auto;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 40px;
}

.page-header {
  margin-bottom: 28px;
}

.spelling-notice {
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid #ead4a8;
  border-radius: 10px;
  background: #fff8e8;
  color: #5c4a22;
  font-size: 0.95rem;
  line-height: 1.45;
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #7a6b58;
}

h1 {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.progress {
  margin-bottom: 28px;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4d9cb;
}

.progress-bar span {
  display: block;
  width: 33%;
  height: 100%;
  background: #3a6ea5;
  transition: width 0.25s ease;
}

.progress-label {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #6d6255;
}

.form-page {
  padding: 28px;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.section-title {
  margin: 0 0 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eadfce;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 1.25rem;
  font-weight: 500;
}

.section-title.line-items {
  margin-top: 28px;
}

.section-desc {
  margin: 0 0 22px;
  color: #5c5348;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  margin-bottom: 18px;
}

.field:last-child {
  margin-bottom: 0;
}

label,
legend {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 600;
}

.req {
  font-weight: 400;
  color: #9a3b2f;
}

.hint {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: #6d6255;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d3c6b4;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
}

select {
  display: block;
  padding: 11px 36px 11px 12px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%232a241c' d='M4 6l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

input:focus,
select:focus {
  outline: 2px solid #3a6ea5;
  outline-offset: 1px;
  border-color: #3a6ea5;
}

input.invalid,
select.invalid {
  border-color: #b42318;
}

fieldset {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

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

.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e3d8ca;
  border-radius: 8px;
  font-weight: 400;
  cursor: pointer;
  background: #fff;
}

.radio-row:has(input:checked),
.check-row:has(input:checked) {
  border-color: #3a6ea5;
  background: #f3f7fb;
}

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

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e3d8ca;
  border-radius: 8px;
  font-weight: 400;
  cursor: pointer;
  background: #fff;
}

.check-row input {
  margin-top: 3px;
}

.image-choices {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.image-choices.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.image-choice {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}

.image-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 2px solid #e3d8ca;
  border-radius: 12px;
  background: #fff;
}

.image-choice input:checked + .choice-card {
  border-color: #3a6ea5;
  box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.18);
}

.image-choice.invalid .choice-card,
.radio-row.invalid {
  border-color: #b42318;
}

.img-placeholder img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-choice input:focus-visible + .choice-card {
  outline: 2px solid #3a6ea5;
  outline-offset: 2px;
}

.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background:
    repeating-linear-gradient(
      45deg,
      #efe7dc,
      #efe7dc 10px,
      #f7f1e8 10px,
      #f7f1e8 20px
    );
  color: #8a7b68;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.choice-label {
  flex: 1;
  padding: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

.form-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  padding: 12px 22px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-primary {
  color: #fff;
  background: #3a6ea5;
}

.btn-primary:hover:not(:disabled) {
  background: #2f5b8a;
}

.btn-secondary {
  color: #2a241c;
  background: #e8dfd2;
}

.btn-secondary:hover {
  background: #ddd2c2;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
}

.alert-error {
  color: #7a1c14;
  background: #fde8e6;
}

.alert-success {
  color: #1f5b38;
  background: #e4f5ea;
}

.review {
  display: grid;
  gap: 0;
}

.review-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eadfce;
}

.review-row dt {
  margin: 0;
  font-weight: 600;
}

.review-row dd {
  margin: 0;
}

.hp-field {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.site-footer {
  padding: 24px 20px 32px;
  text-align: center;
}

.site-footer a {
  color: #8a8a8a;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.site-footer a:hover {
  color: #3a6ea5;
  text-decoration: underline;
}

.thank-you {
  padding: 48px 32px;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  background: #fff;
  text-align: center;
}

.thank-you h1 {
  margin-bottom: 10px;
}

.thank-you p {
  margin: 0;
  color: #5c5348;
}

@media (max-width: 800px) {
  .image-choices.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .review-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 600px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .back-btn {
    justify-self: center;
    order: 2;
  }

  .logo {
    order: 1;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .form-page {
    padding: 20px 16px;
  }

  .form-nav {
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
  }
}
