/* Quote form styles for JVan's Cargo Solutions.
   Mobile-first: authored at 390px, then widened with min-width media queries.
   All colors are CSS custom properties in this single :root block so the
   owner's real brand colors can replace them later in one edit. */

:root {
  --color-primary: #1e3a5f;      /* brand navy, used for header and focus states */
  --color-accent: #b85714;       /* CTA button background */
  --color-accent-hover: #96470f; /* CTA button pressed/hover */
  --color-accent-stripe: #e2711d;/* decorative highlight only, not used for text */
  --color-bg: #f5f7fa;           /* page background */
  --color-surface: #ffffff;      /* cards, inputs */
  --color-text: #1a1f26;         /* body text */
  --color-text-muted: #4b5563;   /* secondary text */
  --color-border: #7c8a98;       /* input borders */
  --color-result-bg: #f5c388;    /* result panel background */
  --color-white: #ffffff;
  --color-error: #a4262c;        /* validation error text/border, 6.77:1 on --color-bg */
  --color-shadow: rgba(0, 0, 0, 0.12); /* suggestion-list drop shadow */

  --radius: 10px;
  --control-height: 48px;
  --gap: 16px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* Header / branding.
   No logo file exists for this business, so the brief's fallback is a strong
   typeface treatment of the business name instead of an invented logo. */
.site-header {
  background: var(--color-primary);
  margin: 0 -20px 24px;
  padding: 28px 20px 22px;
  text-align: center;
}

.brand {
  margin: 0;
  color: var(--color-white);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.tagline {
  margin: 6px 0 0;
  color: var(--color-white);
  opacity: 0.85;
  font-size: 14px;
}

.intro {
  margin-bottom: 20px;
}

.intro h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}

.intro p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 15px;
}

/* Form */
#quote-form {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative; /* anchors the autocomplete suggestion list */
}

label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

input[type="text"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 12px 14px;
  font-size: 16px; /* 16px prevents iOS Safari from auto-zooming on focus */
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
}

textarea {
  min-height: 88px;
  padding-top: 12px;
  resize: vertical;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%),
    linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% - 3px), calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}

/* Validation errors. app.js sets aria-invalid and inserts a .field-error
   paragraph right after the offending control; both clear together once
   the field becomes valid. */
input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--color-error);
}

.field-error {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-error);
}

/* Autocomplete suggestion lists.
   Empty containers for Task 5 to populate as the user types in #pickup /
   #dropoff. Collapsed to nothing while empty so they take no visual space
   until real data lands in them. */
.suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.suggestions:empty {
  display: none;
}

.suggestions:not(:empty) {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  margin-top: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--color-shadow);
  overflow: hidden;
}

.suggestions li {
  padding: 12px 14px;
  font-size: 15px;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-bg);
  cursor: pointer;
}

.suggestions li:last-child {
  border-bottom: none;
}

.btn-submit {
  min-height: var(--control-height);
  margin-top: 4px;
  padding: 14px 20px;
  background: var(--color-accent);
  color: var(--color-white);
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.btn-submit:hover,
.btn-submit:active {
  background: var(--color-accent-hover);
}

.btn-submit:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Result panel: the whole point of the page. Empty until Task 5 fills it
   with the estimated price, so it stays collapsed (no empty box on load). */
#result {
  margin-top: 4px;
}

#result:empty {
  display: none;
  margin: 0;
}

#result:not(:empty) {
  padding: 20px;
  background: var(--color-result-bg);
  border-left: 6px solid var(--color-accent-stripe);
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
}

.site-footer {
  margin-top: 32px;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* Wider screens: a little breathing room, still a single column. */
@media (min-width: 600px) {
  .page {
    padding: 0 32px 48px;
  }

  .site-header {
    margin: 0 -32px 28px;
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .brand {
    font-size: 30px;
  }
}
