:root {
  color-scheme: light;
  --navy: #18242f;
  --navy-deep: #101923;
  --tan: #e0c394;
  --red: #9b3128;
  --paper: #faf7f0;
  --line: #d9cdb9;
  --ink: #1f2830;
  --muted: #50565a;
  font: 1rem/1.55 system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: #efe9de;
}

.page {
  max-width: 59rem;
  margin: clamp(0rem, 5vw, 3rem) auto;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 16px 52px #241a1218;
}

.hero {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) 1fr;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 3rem);
  padding: clamp(1.5rem, 5vw, 3rem);
  color: #fffaf0;
  background: linear-gradient(120deg, var(--navy-deep), #293947);
  border-top: .35rem solid var(--red);
  border-bottom: .25rem solid var(--tan);
}

.brand-mark {
  display: grid;
  place-items: center;
  background: white;
  border: 2px solid var(--tan);
  border-radius: .6rem;
  padding: .5rem;
}

.brand-mark img { display: block; width: 100%; height: auto; }
.hero p { max-width: 35rem; margin: .75rem 0 0; }
.hero .ownership {
  margin: 0 0 .7rem;
  color: var(--tan);
  font-size: .875rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, legend { line-height: 1.15; font-weight: 800; }
h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 3.6rem); letter-spacing: -.045em; }
h2 { margin: 0 0 1rem; font-size: 1.35rem; }

form { padding: clamp(1rem, 4.5vw, 2.75rem); }

form section, fieldset {
  min-inline-size: 0;
  margin: 0 0 1.4rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: #fffdfa;
}

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

.wide, .room-row h3 { grid-column: 1 / -1; }
label { display: block; font-weight: 650; }

input:not([type="radio"], [type="checkbox"]), select, textarea {
  display: block;
  width: 100%;
  min-height: 2.8rem;
  margin-top: .35rem;
  padding: .6rem .7rem;
  border: 1px solid #938879;
  border-radius: .4rem;
  font: inherit;
  font-weight: 400;
  color: inherit;
  background-color: white;
}

select {
  appearance: none;
  padding-right: 2.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='m4 7 5 5 5-5' fill='none' stroke='%2318242f' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .65rem center;
}

textarea { resize: vertical; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--red); }
legend { padding: 0 .5rem; font-size: 1.15rem; }
fieldset label { margin-bottom: .6rem; }
fieldset p { margin: .6rem 0 0; color: var(--muted); }

.room-row {
  margin: 1rem 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--paper);
}

.room-row h3 { margin: 0; font-size: 1rem; }
#painting-options { margin-top: 1rem; }

#calculator {
  margin: 0 0 1rem;
  padding: 1rem;
  border-inline-start: .25rem solid var(--red);
  border-radius: .3rem;
  background: #f2e8d8;
}

#calculator p { margin: .6rem 0 0; }
#range { font-weight: 750; }
#range:empty { margin: 0; }
#range-note { color: var(--muted); }
#status:empty { display: none; }

button, input::file-selector-button {
  font: inherit;
  font-weight: 750;
  border: 0;
  border-radius: .4rem;
  cursor: pointer;
}

button { min-height: 2.8rem; padding: .65rem 1.2rem; color: white; background: var(--navy); }
button:hover { background: #30485a; }
button:disabled { opacity: .65; cursor: wait; }
button[type="submit"] { background: var(--red); }
button[type="submit"]:hover { background: #79241e; }
input::file-selector-button { margin-inline-end: .7rem; padding: .35rem .65rem; background: #eee0ca; color: var(--ink); }

:focus-visible { outline: 3px solid #a04b23; outline-offset: 3px; }
.trap { position: absolute; left: -9999px; }
#status { margin: 0 clamp(1rem, 4.5vw, 2.75rem) 1.5rem; padding: 1rem; border: 1px solid var(--line); border-radius: .4rem; font-weight: 650; background: #fffdfa; }
form[hidden] + #status { margin-top: 1.5rem; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  padding: 1rem clamp(1rem, 4.5vw, 2.75rem);
  border-top: 2px solid var(--tan);
  background: var(--navy-deep);
  color: #fffaf0;
  font-size: .875rem;
  font-weight: 650;
}

footer span { color: var(--tan); font-weight: 500; }

@media (max-width: 640px) {
  .page { margin: 0; border: 0; border-radius: 0; }
  .hero { grid-template-columns: 1fr; }
  .brand-mark { width: min(100%, 13rem); }
  .grid, .room-row { grid-template-columns: 1fr; }
  .form-actions button, #ballpark { width: 100%; }
}

.address-grid, .service-grid {
  display: grid;
  gap: .65rem 1rem;
}
.address-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#services { min-width: 0; margin: 0; }
#services-help { margin-top: 0; }
.service-grid label { display: flex; align-items: baseline; gap: .5rem; margin: 0; }
label[hidden] { display: none; }
@media (max-width: 480px) {
  .address-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .address-grid label:first-child { grid-column: 1 / -1; }
  .service-grid { grid-template-columns: 1fr; }
}
