:root {
  --bg: #f5f4f1;
  --panel: #ffffff;
  --ink: #1f2523;
  --muted: #646b67;
  --line: #dad8d2;
  --field: #fbfaf8;
  --dark: #242826;
  --dark-hover: #151817;
  --success-bg: #edf6ef;
  --success: #245c38;
  --error-bg: #fff0ed;
  --error: #9a341f;
  --shadow: 0 24px 70px rgba(26, 29, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(31, 37, 35, 0.06), transparent 34%), var(--bg);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.quote-panel {
  width: min(100%, 680px);
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid rgba(36, 40, 38, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.quote-header {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.quote-header > div {
  min-width: 0;
  text-align: center;
}

.quote-logo {
  width: min(220px, 52vw);
  height: auto;
  display: block;
  margin: 0 0 8px;
  object-fit: contain;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.75rem);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.quote-greeting {
  margin: 10px 0 8px;
  color: #6f746f;
  font-size: clamp(1rem, 3vw, 1.18rem);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.quote-intro {
  max-width: 440px;
  margin: 16px auto 0;
  color: #6f746f;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.quote-greeting + .quote-intro {
  margin-top: 12px;
}

.home-link {
  display: block;
  width: fit-content;
  margin: 18px auto 0;
  color: #6f746f;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.quote-form {
  display: grid;
  gap: 16px;
}

.tally-embed-wrap {
  min-height: 520px;
  margin-top: -6px;
}

.tally-embed {
  width: 100%;
  min-height: 520px;
  border: 0;
  display: block;
}

.field-group {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
}

.field-group input,
.field-group textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field-group input {
  min-height: 48px;
  padding: 0 14px;
}

.field-group textarea {
  min-height: 156px;
  resize: vertical;
  padding: 14px;
}

.field-group input:focus,
.field-group textarea:focus,
.upload-box:focus-within {
  border-color: #7d8580;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(36, 40, 38, 0.08);
}

.upload-box {
  min-height: 86px;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 18px;
  border: 1px dashed #a9aca7;
  border-radius: 8px;
  background: #f8f7f4;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.upload-title {
  color: var(--ink);
  font-weight: 800;
}

.upload-helper {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}

.upload-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.zip-field {
  grid-column: 1 / -1;
}

.submit-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease;
}

.submit-button:hover:not(:disabled) {
  background: var(--dark-hover);
}

.submit-button:active:not(:disabled) {
  transform: translateY(1px);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.82;
}

.loading-dot {
  width: 16px;
  height: 16px;
  display: none;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.quote-form.is-loading .loading-dot {
  display: inline-block;
}

.form-message {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: transparent;
  font-size: 0.94rem;
  line-height: 1.35;
}

.form-message.success {
  background: var(--success-bg);
  color: var(--success);
}

.form-message.error {
  background: var(--error-bg);
  color: var(--error);
}

.form-message a {
  color: inherit;
  font-weight: 800;
}

.thank-you-panel {
  text-align: center;
}

.thank-you-message {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.5;
}

.return-link {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.return-link:hover {
  text-decoration: underline;
}

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

@media (max-width: 680px) {
  .page-shell {
    align-items: start;
    padding: 12px;
  }

  .quote-panel {
    min-height: calc(100vh - 24px);
    padding: 20px;
  }

  .quote-header {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .quote-logo {
    width: min(176px, 48vw);
    margin-inline: 0;
  }

  h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

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

@media (max-width: 420px) {
  .quote-panel {
    padding: 18px;
  }

  .quote-header {
    gap: 10px;
  }

  .quote-logo {
    width: min(152px, 52vw);
  }

  h1 {
    font-size: clamp(1.32rem, 6vw, 1.65rem);
  }

  .tally-embed-wrap,
  .tally-embed {
    min-height: 560px;
  }
}
