/* Premier Automation · Robot PM Estimator */

:root {
  --pa-navy: #011134;
  --pa-blue-dark: #0061A5;
  --pa-blue-light: #0093DD;
  --pa-orange-dark: #E77817;
  --pa-orange-light: #F49522;

  --ink: #0F1B33;          /* body text, a navy-tinted near-black */
  --ink-muted: #4D5B73;
  --ink-subtle: #6B778C;
  --line: #D9DFE8;
  --line-soft: #E9EDF3;
  --surface: #FFFFFF;
  --surface-sunk: #F5F7FA;
  --page: #EEF1F5;

  --ok-bg: #EDF8F1; --ok-ink: #1D5E36; --ok-line: #BFE3CC;
  --err-bg: #FDF0EF; --err-ink: #A1271B; --err-line: #F2C9C4;
  --info-bg: #EEF6FC; --info-ink: #0B4A78; --info-line: #C7E1F3;

  --font-head: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --radius-sm: 6px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(1, 17, 52, 0.06), 0 8px 24px -12px rgba(1, 17, 52, 0.18);
  --focus: 0 0 0 3px rgba(0, 147, 221, 0.35);

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }
/* No vh-based heights: inside an auto-height iframe they cause resize loops. */
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
.is-embedded, .is-embedded body { background: transparent; overflow: hidden; }

.app { max-width: 760px; margin: 0 auto; padding: 40px 20px 48px; }
.is-embedded .app { padding: 4px 4px 8px; }

/* ── Panel ──────────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 36px);
}

.group { border: 0; min-width: 0; }
.group + .group { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line-soft); }
.group-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  color: var(--pa-navy);
  margin-bottom: 16px;
  padding: 0;
  float: left;   /* lets the fieldset border-top run full width */
  width: 100%;
}
.group-title + * { clear: both; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.grid > .field { margin-bottom: 0; }
.grid--zip { grid-template-columns: minmax(0, 1fr) 180px; }

.field { margin-bottom: 18px; min-width: 0; }
.field:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.optional { color: var(--ink-subtle); font-weight: 400; }

input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #C3CCD8;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
textarea { resize: vertical; min-height: 96px; }
select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23011134' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
input::placeholder, textarea::placeholder { color: #98A2B3; }
input:hover, select:hover:not(:disabled), textarea:hover { border-color: #9AA7B8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pa-blue-dark); box-shadow: var(--focus); }
select:disabled { background-color: var(--surface-sunk); color: var(--ink-subtle); cursor: not-allowed; }
[aria-invalid="true"] { border-color: var(--err-ink); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.actions { margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 14px 24px;
  font-family: var(--font-head);
  font-size: 16px; font-weight: 600; letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn--primary { background: var(--pa-blue-dark); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--pa-navy); }
/* Step 1 and step 2 primary buttons: Premier light blue, dark blue on hover.
   The green "Quote Submitted" state on the email button is kept. */
#submitBtn.btn--primary,
#sendBtn.btn--primary:not(.btn--done) { background: var(--pa-blue-light); color: #FFFFFF; }
#submitBtn.btn--primary:hover:not(:disabled),
#sendBtn.btn--primary:not(.btn--done):hover:not(:disabled) { background: var(--pa-blue-dark); }
.btn:disabled { cursor: not-allowed; opacity: .7; }
.btn--done, .btn--done:disabled { background: var(--ok-ink); opacity: 1; }

.link-btn {
  background: none; border: 0; padding: 4px 0;
  font: inherit; font-size: 14px; font-weight: 500;
  color: var(--pa-blue-dark);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--pa-navy); }
.link-btn:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 2px; }

.spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Messages ───────────────────────────────────────────────────────────── */
.msg { font-size: 14px; line-height: 1.5; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; margin-top: 16px; }
.msg:empty { display: none; }
.msg--err { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-line); }
.msg--ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.msg--info { background: var(--info-bg); color: var(--info-ink); border-color: var(--info-line); }
.msg strong { font-weight: 600; }

/* ── Results ────────────────────────────────────────────────────────────── */
.result-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px;
  margin-bottom: 24px;
}
.result-head h2 { font-family: var(--font-head); font-size: 24px; font-weight: 600; color: var(--pa-navy); line-height: 1.2; }
.result-head h2:focus { outline: none; }
.quote-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; color: var(--ink-muted); }
.quote-meta b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.details { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
.details h3 { font-family: var(--font-head); font-size: 15px; font-weight: 600; color: var(--pa-navy); margin-bottom: 8px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.dl dt { color: var(--ink-subtle); }
.dl dd { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }

/* The one bold element: the total. */
.total {
  position: relative;
  background: var(--pa-navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 28px 26px;
  overflow: hidden;
}
.total::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: linear-gradient(180deg, var(--pa-orange-light), var(--pa-orange-dark));
}
.total-label { font-size: 14px; color: rgba(255,255,255,.78); }
.total-value {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(34px, 7vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.total-note { margin-top: 10px; font-size: 13px; color: rgba(255,255,255,.72); max-width: 56ch; }

.fine { margin-top: 20px; font-size: 13px; line-height: 1.6; color: var(--ink-muted); }
.fine p + p { margin-top: 8px; }

.notes { margin-top: 24px; padding: 18px 20px; background: var(--surface-sunk); border-radius: var(--radius-sm); }
.notes h3 { font-family: var(--font-head); font-size: 15px; font-weight: 600; color: var(--pa-navy); margin-bottom: 8px; }
.notes ul { padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--ink-muted); }
.notes li + li { margin-top: 6px; }

.consent { margin-top: 24px; display: grid; gap: 12px; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: 14px; font-weight: 400; color: var(--ink); margin: 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; padding: 0; appearance: auto; accent-color: var(--pa-blue-dark); }
.privacy { font-size: 13px; color: var(--ink-muted); margin-top: 12px; }
.privacy a { color: var(--pa-blue-dark); }

.back { margin-top: 14px; text-align: center; }

[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .app { padding: 24px 14px 32px; }
  .grid, .grid--zip, .details { grid-template-columns: 1fr; }
  .total { padding: 20px 20px 22px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 1.5s !important; }
}
