/* AtoZ Instant Quote — Customer widget styles
 * Design system: modern, mobile-first, accessible (WCAG AA),
 * uses CSS variables for white-label theming.
 */

:root {
  --atoziq-primary: #0F766E;
  --atoziq-primary-700: color-mix(in srgb, var(--atoziq-primary) 80%, black);
  --atoziq-primary-50:  color-mix(in srgb, var(--atoziq-primary) 8%,  white);
  --atoziq-accent:  #F59E0B;
  --atoziq-corner:  14px;
  --atoziq-text:    #0F172A;
  --atoziq-muted:   #64748B;
  --atoziq-border:  #E2E8F0;
  --atoziq-bg:      #FFFFFF;
  --atoziq-bg-soft: #F8FAFC;
  --atoziq-success: #16A34A;
  --atoziq-error:   #DC2626;
  --atoziq-shadow:  0 8px 32px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .05);
  --atoziq-shadow-lg: 0 20px 48px rgba(15, 23, 42, .12);
  --atoziq-font:    -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --atoziq-text:    #F1F5F9;
    --atoziq-muted:   #94A3B8;
    --atoziq-border:  #1E293B;
    --atoziq-bg:      #0F172A;
    --atoziq-bg-soft: #1E293B;
  }
}

.atoziq {
  font-family: var(--atoziq-font);
  color: var(--atoziq-text);
  background: var(--atoziq-bg);
  border-radius: var(--atoziq-corner);
  box-shadow: var(--atoziq-shadow);
  max-width: 880px;
  margin: 0 auto;
  overflow: hidden;
  container-type: inline-size;
}

.atoziq * { box-sizing: border-box; }

.atoziq__shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 540px;
}

/* Header / progress */
.atoziq__head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--atoziq-border);
  background: linear-gradient(180deg, var(--atoziq-primary-50), transparent);
}
.atoziq__steps {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.atoziq__step {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--atoziq-border);
  transition: background .25s;
}
.atoziq__step.is-active { background: var(--atoziq-primary); }
.atoziq__title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.atoziq__subtitle { margin: 4px 0 0; color: var(--atoziq-muted); font-size: 14px; }

/* Body */
.atoziq__body {
  padding: 24px;
  min-height: 360px;
}

/* Form fields */
.atoziq__field { margin-bottom: 14px; }
.atoziq__label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 6px; color: var(--atoziq-muted);
}
.atoziq__input,
.atoziq__select,
.atoziq__textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--atoziq-border);
  border-radius: 10px;
  background: var(--atoziq-bg);
  color: var(--atoziq-text);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.atoziq__input:focus,
.atoziq__select:focus,
.atoziq__textarea:focus {
  outline: none;
  border-color: var(--atoziq-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--atoziq-primary) 20%, transparent);
}
.atoziq__row {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@container (min-width: 520px) {
  .atoziq__row.is-2 { grid-template-columns: 1fr 1fr; }
  .atoziq__row.is-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Buttons */
.atoziq__btn {
  appearance: none; border: 0; cursor: pointer;
  padding: 12px 20px; font: inherit; font-weight: 600;
  border-radius: 10px;
  transition: transform .04s, background .15s, box-shadow .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.atoziq__btn:active { transform: translateY(1px); }
.atoziq__btn--primary {
  background: var(--atoziq-primary); color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--atoziq-primary) 30%, transparent);
}
.atoziq__btn--primary:hover { background: var(--atoziq-primary-700); }
.atoziq__btn--ghost {
  background: transparent; color: var(--atoziq-text);
  border: 1px solid var(--atoziq-border);
}
.atoziq__btn--block { width: 100%; justify-content: center; }
.atoziq__btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Footer / nav */
.atoziq__foot {
  padding: 16px 24px;
  border-top: 1px solid var(--atoziq-border);
  background: var(--atoziq-bg-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* Map */
.atoziq__map {
  height: 360px; width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--atoziq-bg-soft);
  position: relative;
  border: 1px solid var(--atoziq-border);
}
.atoziq__map-toolbar {
  position: absolute; top: 12px; left: 12px;
  display: flex; gap: 6px; z-index: 5;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  padding: 6px; border-radius: 10px;
  box-shadow: var(--atoziq-shadow);
}
.atoziq__chip {
  appearance: none; border: 0; background: transparent; padding: 6px 10px;
  font: inherit; font-size: 13px; font-weight: 500; border-radius: 6px;
  cursor: pointer; color: var(--atoziq-muted);
}
.atoziq__chip.is-active { background: var(--atoziq-primary); color: #fff; }
.atoziq__footage-pill {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 23, 42, .9); color: #fff; padding: 8px 16px;
  border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: var(--atoziq-shadow-lg);
}

/* Product grid */
.atoziq__products {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@container (min-width: 600px) { .atoziq__products { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 860px) { .atoziq__products { grid-template-columns: repeat(3, 1fr); } }

.atoziq__product {
  border: 2px solid var(--atoziq-border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  background: var(--atoziq-bg);
  transition: border-color .15s, transform .08s, box-shadow .15s;
  text-align: left;
}
.atoziq__product:hover { transform: translateY(-2px); box-shadow: var(--atoziq-shadow); }
.atoziq__product.is-selected {
  border-color: var(--atoziq-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--atoziq-primary) 18%, transparent);
}
.atoziq__product h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.atoziq__product p  { margin: 0; font-size: 13px; color: var(--atoziq-muted); }
.atoziq__product-price { margin-top: 8px; font-weight: 600; color: var(--atoziq-primary); }

/* Reveal card */
.atoziq__reveal {
  text-align: center;
  padding: 32px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--atoziq-primary-50), transparent);
  border: 1px solid color-mix(in srgb, var(--atoziq-primary) 18%, transparent);
}
.atoziq__reveal-amount {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--atoziq-primary);
  margin: 6px 0;
}
.atoziq__reveal-foot { color: var(--atoziq-muted); font-size: 13px; }

/* Takeoff sheet (Pro) */
.atoziq__takeoff {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@container (min-width: 720px) { .atoziq__takeoff { grid-template-columns: 1fr 320px; } }

.atoziq__takeoff table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.atoziq__takeoff th,
.atoziq__takeoff td {
  padding: 8px 10px; border-bottom: 1px solid var(--atoziq-border);
  text-align: left;
}
.atoziq__takeoff th { background: var(--atoziq-bg-soft); font-weight: 500; color: var(--atoziq-muted); }
.atoziq__takeoff .num { text-align: right; font-variant-numeric: tabular-nums; }

.atoziq__summary {
  background: var(--atoziq-bg-soft);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--atoziq-border);
  position: sticky; top: 12px;
}
.atoziq__summary-row { display: flex; justify-content: space-between; padding: 6px 0; }
.atoziq__summary-row.is-grand {
  font-size: 18px; font-weight: 700; color: var(--atoziq-primary);
  border-top: 1px solid var(--atoziq-border); margin-top: 6px; padding-top: 12px;
}

/* Photo upload */
.atoziq__photo-drop {
  border: 2px dashed var(--atoziq-border);
  border-radius: 12px; padding: 32px;
  text-align: center; cursor: pointer;
  background: var(--atoziq-bg-soft);
  transition: border-color .15s, background .15s;
}
.atoziq__photo-drop:hover { border-color: var(--atoziq-primary); background: var(--atoziq-primary-50); }
.atoziq__photo-drop input { display: none; }
.atoziq__photo-thumb {
  border-radius: 10px;
  width: 100%; aspect-ratio: 4/3;
  object-fit: cover; cursor: crosshair;
}

/* Spinner */
.atoziq__spinner {
  width: 18px; height: 18px;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: atoziq-spin .8s linear infinite;
  display: inline-block;
}
@keyframes atoziq-spin { to { transform: rotate(360deg); } }

/* Signature pad */
.atoziq__sig {
  width: 100%; aspect-ratio: 16/6;
  border: 1px solid var(--atoziq-border);
  border-radius: 10px;
  background: var(--atoziq-bg);
  touch-action: none;
}

/* Stripe */
.atoziq__stripe-mount {
  border: 1px solid var(--atoziq-border);
  border-radius: 10px;
  padding: 12px;
  background: var(--atoziq-bg);
}

/* Badges */
.atoziq__badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--atoziq-primary-50);
  color: var(--atoziq-primary);
}

.atoziq__error { color: var(--atoziq-error); margin: 8px 0; font-size: 14px; }
.atoziq__success { color: var(--atoziq-success); margin: 8px 0; font-size: 14px; }
.atoziq__hint { font-size: 12px; color: var(--atoziq-muted); margin-top: 4px; }

.atoziq-locked {
  padding: 24px; text-align: center;
  border: 1px dashed var(--atoziq-border); border-radius: 12px;
  color: var(--atoziq-muted);
}
