/* Page-scoped styles for fleet-quote.html. */

.fleet-quote-page [hidden] {
  display: none !important;
}

.fleet-quote-page .skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1200;
  transform: translateY(-160%);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--card-shadow-hover);
  font-weight: 700;
}

.fleet-quote-page .skip-link:focus {
  transform: translateY(0);
}

.fleet-quote-content {
  max-width: 1760px;
  margin-right: auto;
}

.fleet-quote-header {
  align-items: flex-start;
}

.fleet-quote-header h1 {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.25rem;
}

.fleet-quote-header h1 svg {
  width: 1.7rem;
  height: 1.7rem;
  color: var(--blue);
  stroke-width: 2;
}

.page-kicker,
.card-eyebrow {
  margin-bottom: 0.25rem;
  color: var(--blue);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-intro {
  max-width: 70ch;
  color: var(--muted);
  font-size: 0.9375rem;
}

.feature-note {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.875rem;
}

.feature-note.feature-enabled {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.fleet-quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(350px, 0.85fr);
  gap: 1.25rem;
  align-items: start;
}

.quote-card {
  min-width: 0;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

.quote-results-card {
  position: sticky;
  top: 1.25rem;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.card-heading h2 {
  font-size: 1.25rem;
  line-height: 1.25;
}

.preview-state,
.quote-ref {
  flex-shrink: 0;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: #f0ede8;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.preview-state.is-loading {
  background: #dbeafe;
  color: #1e40af;
}

.preview-state.is-error {
  background: #fee2e2;
  color: #991b1b;
}

.quote-ref.is-saved {
  background: #dcfce7;
  color: #166534;
}

.form-section {
  min-width: 0;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}

.form-section + .form-section {
  padding-top: 1.25rem;
  border-top: 1px solid #e8e5df;
}

.form-section legend {
  width: 100%;
  margin-bottom: 0.75rem;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 700;
}

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

.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.3rem;
}

.form-field.full-width,
.notes-field {
  grid-column: 1 / -1;
}

.form-field label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.required-marker {
  color: #b42318;
}

.form-field .input,
.summary-output {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.625rem 0.75rem;
  border: 1px solid #c9c5be;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
}

.form-field textarea.input {
  min-height: 92px;
  resize: vertical;
}

.form-field .input:disabled {
  background: #f0ede8;
  color: #77716a;
  cursor: not-allowed;
  opacity: 1;
}

.form-field .input[aria-invalid="true"] {
  border-color: #b42318;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.12);
}

.field-help {
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.4;
}

.field-error {
  color: #b42318;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
}

.money-input {
  position: relative;
}

.money-input > span {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.money-input .input {
  padding-left: 1.5rem;
}

.check-row,
.modifier-option {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
}

.check-row input,
.modifier-option input {
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.modifier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.modifier-option {
  padding: 0.5rem 0.75rem;
  border: 1px solid #dedad3;
  border-radius: var(--radius-sm);
  background: #fafaf8;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.modifier-option:has(input:checked) {
  border-color: var(--blue);
  background: #eff6ff;
}

.modifier-costs {
  padding-top: 0.25rem;
}

.notes-field {
  margin-bottom: 1.25rem;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e8e5df;
}

.save-help {
  max-width: 55ch;
  color: var(--muted);
  font-size: 0.75rem;
}

.save-quote-button {
  min-width: 130px;
  min-height: 44px;
  justify-content: center;
}

.save-quote-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-status,
.copy-status,
.recent-quotes-status {
  min-height: 1.25rem;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.quote-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.quote-metric {
  min-width: 0;
  padding: 0.875rem;
  border: 1px solid #e8e5df;
  border-radius: var(--radius);
  background: #fafaf8;
}

.quote-metric-total {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.metric-label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quote-metric strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.quote-metric-total strong {
  color: #1e40af;
  font-size: 1.5rem;
}

.manual-review {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.875rem;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  background: #fffbeb;
  color: #78350f;
}

.manual-review svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--blue);
}

.manual-review p {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
}

.breakdown-wrapper {
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.quote-breakdown {
  width: 100%;
  min-width: 360px;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.quote-breakdown caption,
.recent-quotes-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.quote-breakdown th,
.quote-breakdown td {
  padding: 0.5rem 0.375rem;
  border-bottom: 1px solid #e8e5df;
}

.quote-breakdown th {
  color: var(--muted);
  font-weight: 500;
  text-align: left;
}

.quote-breakdown td {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quote-breakdown .internal-cost-row {
  background: #fff7ed;
}

.quote-breakdown .subtotal-row th,
.quote-breakdown .subtotal-row td {
  padding-top: 0.75rem;
  border-top: 2px solid #d5d1cb;
  font-weight: 700;
}

.quote-breakdown .total-row th,
.quote-breakdown .total-row td {
  border-bottom: 0;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 800;
}

.result-detail {
  padding-top: 1rem;
  border-top: 1px solid #e8e5df;
}

.result-detail + .result-detail {
  margin-top: 1rem;
}

.result-detail h3 {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.result-detail p,
.warning-list {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.warning-list {
  padding-left: 1.15rem;
}

.warning-list li + li {
  margin-top: 0.35rem;
}

.summary-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.summary-heading-row h3 {
  margin-bottom: 0;
}

.copy-button,
.refresh-quotes-button {
  min-height: 44px;
}

.copy-button svg,
.refresh-quotes-button svg {
  width: 1rem;
  height: 1rem;
  color: var(--blue);
}

.copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.summary-output {
  min-height: 160px;
  resize: vertical;
  background: #fafaf8;
  line-height: 1.5;
}

.recent-quotes-card {
  margin-top: 1.25rem;
}

.recent-quotes-card .data-table-wrapper {
  margin-bottom: 0;
  box-shadow: none;
  border: 1px solid #e8e5df;
}

.recent-quotes-table td {
  min-height: 44px;
}

.recent-quotes-table td:last-child {
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.recent-quotes-empty {
  padding: 1.5rem !important;
  color: var(--muted);
  text-align: center !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.fleet-quote-page :where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.fleet-quote-page .hamburger {
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fleet-quote-page .hamburger svg {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--blue);
}

.fleet-quote-page .sidebar-nav a,
.fleet-quote-page .sidebar-footer a,
.fleet-quote-page .gate-box button,
.fleet-quote-page .gate-box input {
  min-height: 44px;
}

@media (max-width: 1199px) {
  .fleet-quote-layout {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.8fr);
  }

  .modifier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .fleet-quote-page .sidebar {
    transform: translateX(-100%);
  }

  .fleet-quote-page .sidebar.open {
    transform: translateX(0);
  }

  .fleet-quote-page .sidebar-overlay.open {
    display: block;
  }

  .fleet-quote-page .hamburger {
    display: flex;
  }

  .fleet-quote-page .content {
    width: 100%;
    margin-left: 0;
    padding: 4.5rem 1.25rem 1.25rem;
  }

  .fleet-quote-layout {
    grid-template-columns: 1fr;
  }

  .quote-results-card {
    position: static;
  }
}

@media (max-width: 767px) {
  .fleet-quote-page .content {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .quote-card {
    padding: 1.125rem;
  }

  .form-grid,
  .quote-metrics,
  .modifier-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .save-quote-button {
    width: 100%;
  }

  .card-heading {
    align-items: flex-start;
  }
}

@media (min-width: 1920px) {
  .fleet-quote-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(430px, 0.7fr);
  }
}
