/* QUICK-QUOTE-01: the Quick Quote form, its buttons (top bar on Leads CRM, the Lead Pipeline's header) and the Leads form's KSEB note. */

/* Top bar (Leads CRM): shown by the lead-toolbar-control rule on that screen, just before + Add Lead. */
body.lead-workspace-compact .quickquote01-topbar {
  order: 3;
  padding-inline: 12px;
}

.quickquote01-topbar .phone-action-symbol {
  font-weight: 700;
}

/* Lead Pipeline header (desktop and phone). */
.quickquote01-lv4 {
  white-space: nowrap;
}

.lv4-phonetop .quickquote01-lv4--phone {
  margin-left: auto;
  align-self: center;
}

/* The form's layer: 10000 at every width (phone width gives every .os-modal 10000; on desktop .os-modal is 95, under the 240 top bar). */
.os-modal.quickquote01-modal {
  z-index: 10000;
}

/* The same-phone sheet (LEAD-REQ-01, z-index 1200) opens over this form, so it goes just above it (still below the text-action and confirm modals
   at 10030). Only while Quick Quote is open (the sheet comes after it in <body>). */
.os-modal.quickquote01-modal ~ .leadreq01-modal {
  z-index: 10010;
}

/* The Lead Source block (the Leads form's, styled there under #workIntakePanel only). */
.quickquote01-form .lead-source-capture {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  background: #f3fbfa;
  border: 1px solid #b9deda;
  border-left: 3px solid var(--ui-teal);
  border-radius: 8px;
}

.quickquote01-form .lead-source-capture-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.quickquote01-form .lead-source-capture-head span {
  display: block;
  color: var(--ui-muted);
  font-size: 9px;
  font-weight: 850;
}

.quickquote01-form .lead-source-capture-head strong {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.quickquote01-form .lead-source-capture-status {
  flex: 0 1 auto;
  padding: 4px 7px;
  color: var(--ui-teal-dark);
  background: #ffffff;
  border: 1px solid #b9deda;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.3;
  text-align: right;
}

.quickquote01-form .lead-source-capture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quickquote01-form .lead-source-capture-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quickquote01-form .lead-source-capture [hidden] {
  display: none !important;
}

[data-theme="dark"] .quickquote01-form .lead-source-capture {
  color: var(--ui-text);
  background: #10263a;
  border-color: var(--ui-border);
  border-left-color: var(--ui-teal);
}

[data-theme="dark"] .quickquote01-form .lead-source-capture-status {
  background: #091827;
}

/* The form. */
.quickquote01-modal .quickquote01-card {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  /* QUICK-QUOTE-02 row 16: inner padding (16px on a phone, below). */
  box-sizing: border-box;
  padding: 20px;
}

.quickquote01-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  padding: 4px 0 0;
}

.quickquote01-form > label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quickquote01-form > label > span {
  font-size: 12px;
  font-weight: 600;
}

.quickquote01-form input,
.quickquote01-form select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.quickquote01-form .wide-field,
.quickquote01-form .lead-source-capture {
  grid-column: 1 / -1;
}

/* r2 (Claude's build review of 22 Nov, decision 4): the field text. The form is outside .app-shell, so the dark theme's field rules do not reach it and
   its fields kept the base white field with the dark theme's light --ui-text (near invisible). In the dark theme every field here takes the light
   theme's input text colour on that white field, as the light theme gives every field already. */
[data-theme="dark"] .quickquote01-form input,
[data-theme="dark"] .quickquote01-form select {
  color: #17313a;
}

/* The open list's options stay in the input text colour (the empty package choice below must not grey them). */
.quickquote01-form select option {
  color: #17313a;
}

/* Only the empty "Choose a package (optional)" choice reads as a placeholder (the light theme's placeholder colour). */
.quickquote01-form select[name="quickquote01PackageId"]:has(> option[value=""]:checked) {
  color: #8a9ca5;
}

.quickquote01-hint,
.quickquote01-source-note {
  margin: 0;
  font-size: 12px;
  opacity: 0.8;
}

.quickquote01-status {
  margin: 0;
  min-height: 1em;
  font-size: 13px;
  color: #b42318;
}

.quickquote01-status:empty {
  display: none;
}

.quickquote01-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* The Leads form: why the KSEB fields are off while the phone is blank. */
.quickquote01-kseb-note {
  margin: 0;
  font-size: 12px;
  color: #8a4b0f;
}

.quickquote01-kseb-note[hidden] {
  display: none;
}

[data-theme="dark"] .quickquote01-kseb-note {
  color: #f2b46d;
}

[data-theme="dark"] .quickquote01-status {
  color: #ff9c8f;
}

@media (max-width: 640px) {
  .quickquote01-modal .quickquote01-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .quickquote01-form,
  .quickquote01-form .lead-source-capture-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .quickquote01-actions {
    flex-direction: column-reverse;
  }

  .quickquote01-actions button {
    width: 100%;
  }
}
