/*!
 * Instant Estimate — Project Price Calculator v1.0.0
 * Made by Vortaxis Studio · https://vortaxis.com/store
 *
 * Theming: override any --ie-* custom property on .ie (or on a parent with
 * a more specific selector). Presets: data-ie-theme="dark" | "light" | "auto".
 */

/* ---------- 1. Tokens: dark preset (default) ---------- */
.ie {
  --ie-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --ie-font-display: var(--ie-font);
  --ie-accent: #8b7bff;
  --ie-accent-2: #3fd0ff;
  --ie-gradient: linear-gradient(100deg, var(--ie-accent), var(--ie-accent-2));
  --ie-bg: #0b0a12;
  --ie-surface: #12101d;
  --ie-surface-2: #1c1930;
  --ie-surface-3: #262242;
  --ie-text: #f2effb;
  --ie-muted: #a7a2bd;
  --ie-line: rgba(255, 255, 255, .08);
  --ie-line-2: rgba(255, 255, 255, .15);
  --ie-chip-on-bg: var(--ie-text);
  --ie-chip-on-text: var(--ie-bg);
  --ie-multi-on-bg: color-mix(in srgb, var(--ie-accent) 20%, transparent);
  --ie-btn-bg: var(--ie-text);
  --ie-btn-text: var(--ie-bg);
  --ie-success: #4ade80;
  --ie-error: #ff7b7b;
  --ie-radius: 24px;
  --ie-radius-sm: 14px;
  --ie-gap: 24px;
  --ie-pad: clamp(20px, 4cqi, 34px);
  --ie-shadow: 0 30px 80px -40px rgba(0, 0, 0, .75);
  --ie-glow-opacity: .26;
  --ie-sticky-top: 24px;
  --ie-ease: cubic-bezier(.2, .8, .2, 1);

  container: ie / inline-size;
  color: var(--ie-text);
  font-family: var(--ie-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-align: start;
}

/* ---------- 2. Light preset ---------- */
.ie[data-ie-theme="light"] {
  --ie-accent: #6a4dff;
  --ie-accent-2: #0ea5e9;
  --ie-bg: #ffffff;
  --ie-surface: #ffffff;
  --ie-surface-2: #f5f4fb;
  --ie-surface-3: #ebe8f7;
  --ie-text: #17142a;
  --ie-muted: #625d78;
  --ie-line: rgba(23, 20, 42, .09);
  --ie-line-2: rgba(23, 20, 42, .17);
  --ie-multi-on-bg: color-mix(in srgb, var(--ie-accent) 11%, #fff);
  --ie-success: #13803d;
  --ie-error: #c62828;
  --ie-shadow: 0 30px 70px -45px rgba(40, 30, 90, .45);
  --ie-glow-opacity: .16;
}

/* auto: light by default, dark when the visitor's system prefers it */
@media (prefers-color-scheme: light) {
  .ie[data-ie-theme="auto"] {
    --ie-accent: #6a4dff; --ie-accent-2: #0ea5e9; --ie-bg: #fff; --ie-surface: #fff; --ie-surface-2: #f5f4fb; --ie-surface-3: #ebe8f7;
    --ie-text: #17142a; --ie-muted: #625d78; --ie-line: rgba(23,20,42,.09); --ie-line-2: rgba(23,20,42,.17);
    --ie-multi-on-bg: color-mix(in srgb, var(--ie-accent) 11%, #fff); --ie-success: #13803d; --ie-error: #c62828;
    --ie-shadow: 0 30px 70px -45px rgba(40,30,90,.45); --ie-glow-opacity: .16;
  }
}

.ie[dir="rtl"] {
  --ie-font: "Vazirmatn", "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Naskh Arabic", system-ui, sans-serif;
}

/* ---------- 3. Base & layout ---------- */
.ie *, .ie *::before, .ie *::after { box-sizing: border-box; }
.ie [hidden] { display: none !important; }
.ie-grid { display: grid; gap: var(--ie-gap); align-items: start; }
@container ie (min-width: 760px) {
  .ie:not(.ie--stacked) .ie-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
  .ie:not(.ie--stacked) .ie-out { position: sticky; top: var(--ie-sticky-top); }
}

.ie-form {
  display: flex; flex-direction: column; gap: 28px; margin: 0;
  padding: var(--ie-pad);
  background: var(--ie-surface);
  border: 1px solid var(--ie-line);
  border-radius: var(--ie-radius);
  box-shadow: var(--ie-shadow);
  min-width: 0;
}
.ie-head { display: flex; flex-direction: column; gap: 6px; }
.ie-title { margin: 0; font: 700 clamp(20px, 3.4cqi, 26px)/1.2 var(--ie-font-display); letter-spacing: -.01em; color: var(--ie-text); }
.ie-subtitle { margin: 0; color: var(--ie-muted); font-size: 15px; }

/* ---------- 4. Fields ---------- */
.ie-field { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ie-label {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 0;
  font-weight: 600; font-size: 15px; color: var(--ie-text); line-height: 1.35;
}
legend.ie-label { margin-bottom: 12px; }
.ie-num {
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em; color: var(--ie-accent);
  padding: 4px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--ie-accent) 14%, transparent);
  font-variant-numeric: tabular-nums;
}
.ie[dir="rtl"] .ie-num { font-family: var(--ie-font); font-size: 12px; letter-spacing: 0; }
.ie-help { margin: -4px 0 2px; font-size: 13.5px; color: var(--ie-muted); }

/* chips (single + multi choice) */
.ie-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ie-chip-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ie-chip {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  min-height: 42px; padding: 9px 16px;
  border: 1px solid var(--ie-line-2); border-radius: 999px;
  background: transparent; color: var(--ie-text);
  font-size: 14.5px; font-weight: 500; line-height: 1.25;
  cursor: pointer; user-select: none;
  transition: background-color .2s, border-color .2s, color .2s, transform .25s var(--ie-ease);
}
.ie-chip:hover { border-color: color-mix(in srgb, var(--ie-text) 45%, transparent); }
.ie-chip:active { transform: scale(.97); }
.ie-chip-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ie-chip-desc { font-size: 12.5px; font-weight: 400; color: var(--ie-muted); }
.ie-chip-hint {
  font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ie-muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.ie[dir="rtl"] .ie-chip-hint { font-family: var(--ie-font); font-size: 12.5px; }
.ie-chip-hint, .ie-range-hint { unicode-bidi: isolate; direction: ltr; }
.ie-price-sep { white-space: pre; }
.ie-chip-input:checked + .ie-chip { background: var(--ie-chip-on-bg); border-color: var(--ie-chip-on-bg); color: var(--ie-chip-on-text); }
.ie-chip-input:checked + .ie-chip .ie-chip-hint,
.ie-chip-input:checked + .ie-chip .ie-chip-desc { color: color-mix(in srgb, var(--ie-chip-on-text) 68%, transparent); }
.ie-chips--multi .ie-chip-input:checked + .ie-chip { background: var(--ie-multi-on-bg); border-color: var(--ie-accent); color: var(--ie-text); }
.ie-chips--multi .ie-chip-input:checked + .ie-chip .ie-chip-hint { color: var(--ie-accent); }
.ie-chip-input:focus-visible + .ie-chip { outline: 2px solid var(--ie-accent); outline-offset: 3px; }

/* check mark for add-ons */
.ie-check {
  flex: none; width: 18px; height: 18px; border-radius: 6px;
  border: 1.5px solid var(--ie-line-2); display: grid; place-items: center;
  transition: background-color .2s, border-color .2s;
}
.ie-check::after {
  content: ""; width: 9px; height: 5px; margin-top: -2px;
  border: solid var(--ie-bg); border-width: 0 0 2px 2px;
  transform: rotate(-45deg) scale(0); transition: transform .2s var(--ie-ease);
}
.ie-chip-input:checked + .ie-chip .ie-check { background: var(--ie-accent); border-color: var(--ie-accent); }
.ie-chip-input:checked + .ie-chip .ie-check::after { transform: rotate(-45deg) scale(1); border-color: #fff; }

/* card style for choices with descriptions */
.ie-chips--cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ie-chips--cards .ie-chip { border-radius: var(--ie-radius-sm); align-items: flex-start; flex-direction: column; padding: 14px 16px; gap: 8px; }
.ie-chips--cards .ie-chip-label { font-weight: 600; }

/* range slider */
.ie-range-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ie-range-out {
  font: 700 15px/1 var(--ie-font); color: var(--ie-text);
  padding: 7px 12px; border-radius: 999px; background: var(--ie-surface-2); border: 1px solid var(--ie-line);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ie-range {
  --ie-fill: 50%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer;
}
.ie-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--ie-accent), var(--ie-accent-2)) 0 0 / var(--ie-fill) 100% no-repeat, var(--ie-surface-3);
}
.ie-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--ie-surface-3); }
.ie-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--ie-gradient); }
.ie-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 0 0 5px color-mix(in srgb, var(--ie-accent) 35%, transparent), 0 4px 12px rgba(0,0,0,.35);
  transition: box-shadow .2s, transform .2s var(--ie-ease);
}
.ie-range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 0;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ie-accent) 35%, transparent), 0 4px 12px rgba(0,0,0,.35);
}
.ie-range:hover::-webkit-slider-thumb, .ie-range:active::-webkit-slider-thumb { transform: scale(1.1); }
.ie-range:focus-visible { outline: none; }
.ie-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--ie-accent), 0 0 0 8px color-mix(in srgb, var(--ie-accent) 30%, transparent); }
.ie-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px var(--ie-accent), 0 0 0 8px color-mix(in srgb, var(--ie-accent) 30%, transparent); }
.ie[dir="rtl"] .ie-range::-webkit-slider-runnable-track {
  background: linear-gradient(to left, var(--ie-accent), var(--ie-accent-2)) 100% 0 / var(--ie-fill) 100% no-repeat, var(--ie-surface-3);
}
.ie-range-scale { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ie-muted); margin-top: -4px; }
.ie-range-hint { color: var(--ie-accent); font-weight: 500; }

/* toggle switch */
.ie-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ie-switch {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  padding: 14px 16px; border: 1px solid var(--ie-line-2); border-radius: var(--ie-radius-sm);
  transition: border-color .2s, background-color .2s;
}
.ie-switch:hover { border-color: color-mix(in srgb, var(--ie-text) 40%, transparent); }
.ie-switch-track {
  flex: none; position: relative; width: 46px; height: 26px; border-radius: 999px;
  background: var(--ie-surface-3); border: 1px solid var(--ie-line-2); transition: background .25s;
}
.ie-switch-thumb {
  position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .25s var(--ie-ease);
}
.ie-switch-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ie-switch-desc { font-size: 13px; color: var(--ie-muted); }
.ie-switch-input:checked + .ie-switch { border-color: var(--ie-accent); background: var(--ie-multi-on-bg); }
.ie-switch-input:checked + .ie-switch .ie-switch-track { background: var(--ie-gradient); border-color: transparent; }
.ie-switch-input:checked + .ie-switch .ie-switch-thumb { transform: translateX(20px); }
.ie[dir="rtl"] .ie-switch-input:checked + .ie-switch .ie-switch-thumb { transform: translateX(-20px); }
.ie-switch-input:checked + .ie-switch .ie-chip-hint { color: var(--ie-accent); }
.ie-switch-input:focus-visible + .ie-switch { outline: 2px solid var(--ie-accent); outline-offset: 3px; }

/* contact inputs */
.ie-contact-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@container ie (min-width: 520px) { .ie-contact-grid { grid-template-columns: 1fr 1fr; } }
.ie-control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ie-control--wide { grid-column: 1 / -1; }
.ie-control-label { font-size: 13.5px; font-weight: 500; color: var(--ie-muted); }
.ie-req { color: var(--ie-accent); }
.ie-input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ie-text);
  background: var(--ie-surface-2); border: 1px solid var(--ie-line-2); border-radius: 12px;
  padding: 11px 14px; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.ie-input::placeholder { color: color-mix(in srgb, var(--ie-muted) 75%, transparent); }
.ie-input:focus { outline: none; border-color: var(--ie-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ie-accent) 25%, transparent); }
.ie-input[aria-invalid="true"] { border-color: var(--ie-error); }
.ie-error { font-size: 12.5px; color: var(--ie-error); min-height: 0; }
.ie-error:empty { display: none; }

.ie-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; inset-inline-start: -9999px; }
.ie-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- 5. Result panel ---------- */
.ie-out {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 16px;
  padding: var(--ie-pad);
  border-radius: var(--ie-radius);
  border: 1px solid var(--ie-line-2);
  background: linear-gradient(160deg, var(--ie-surface-3), var(--ie-surface) 70%);
  box-shadow: var(--ie-shadow);
  min-width: 0;
}
.ie-out::before {
  content: ""; position: absolute; z-index: -1; width: 300px; height: 300px; inset-inline-end: -130px; top: -130px;
  border-radius: 50%; background: var(--ie-gradient); filter: blur(80px); opacity: var(--ie-glow-opacity); pointer-events: none;
}
.ie[data-ie-theme="light"] .ie-out { background: linear-gradient(160deg, var(--ie-surface-2), var(--ie-surface) 70%); }
.ie-kicker {
  font: 600 11.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ie-muted);
}
.ie[dir="rtl"] .ie-kicker { font-family: var(--ie-font); letter-spacing: 0; font-size: 13px; }
.ie-price {
  font: 800 clamp(30px, 8.5cqi, 46px)/1.08 var(--ie-font-display);
  letter-spacing: -.025em; font-variant-numeric: tabular-nums;
  background: var(--ie-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  overflow-wrap: anywhere;
}
@container ie (min-width: 760px) { .ie:not(.ie--stacked) .ie-price { font-size: clamp(30px, 3.6cqi, 46px); } }
.ie[dir="rtl"] .ie-price { letter-spacing: 0; }
.ie-price span { white-space: nowrap; }
.ie-price-note {
  display: block; margin-top: 6px; font: 500 13px/1.3 var(--ie-font); letter-spacing: 0;
  color: var(--ie-muted); -webkit-text-fill-color: var(--ie-muted);
}
.ie-rows { margin: 0; display: flex; flex-direction: column; }
.ie-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--ie-line); font-size: 14px; }
.ie-row dt { color: var(--ie-muted); flex: none; }
.ie-row dd { margin: 0; text-align: end; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.ie-meter { height: 6px; border-radius: 999px; background: var(--ie-surface-3); overflow: hidden; }
.ie-meter span {
  display: block; height: 100%; border-radius: inherit; background: var(--ie-gradient);
  transform-origin: 0 50%; transform: scaleX(.2); transition: transform .55s var(--ie-ease);
}
.ie[dir="rtl"] .ie-meter span { transform-origin: 100% 50%; }

/* buttons */
.ie-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.ie-secondary { display: flex; flex-wrap: wrap; gap: 8px; }
.ie-secondary .ie-btn { flex: 1 1 140px; }
.ie-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
  font: 600 15px/1.2 var(--ie-font); cursor: pointer; text-decoration: none;
  transition: transform .3s var(--ie-ease), background-color .2s, border-color .2s, box-shadow .3s, opacity .2s;
}
.ie-btn--primary { width: 100%; background: var(--ie-btn-bg); color: var(--ie-btn-text); box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--ie-accent) 70%, transparent); }
.ie-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px color-mix(in srgb, var(--ie-accent) 80%, transparent); }
.ie-btn--ghost { background: transparent; color: var(--ie-text); border-color: var(--ie-line-2); font-size: 14px; min-height: 40px; padding: 9px 14px; }
.ie-btn--ghost:hover { border-color: color-mix(in srgb, var(--ie-text) 45%, transparent); }
.ie-btn:focus-visible { outline: 2px solid var(--ie-accent); outline-offset: 3px; }
.ie-btn:disabled, .ie-btn[aria-busy="true"] { opacity: .6; cursor: progress; transform: none; }
.ie-btn-arrow { transition: transform .3s var(--ie-ease); }
.ie-btn--primary:hover .ie-btn-arrow { transform: translateX(4px); }
.ie[dir="rtl"] .ie-btn--primary:hover .ie-btn-arrow { transform: translateX(-4px); }

.ie-status { margin: 0; font-size: 13.5px; font-weight: 500; }
.ie-status:empty { display: none; }
.ie-status[data-kind="success"] { color: var(--ie-success); }
.ie-status[data-kind="error"] { color: var(--ie-error); }
.ie-status[data-kind="busy"], .ie-status[data-kind="info"] { color: var(--ie-muted); }
.ie-note { font-size: 12.5px; color: var(--ie-muted); line-height: 1.5; }

.ie-load-error { padding: 16px 18px; border-radius: 12px; border: 1px dashed currentColor; font: 14px/1.5 system-ui, sans-serif; color: #b42318; background: #fff4f2; }

/* ---------- 6. Mobile price dock + small containers ---------- */
.ie-dock-wrap { display: none; }
@container ie (max-width: 759px) {
  .ie-dock-wrap {
    display: block; position: sticky; bottom: 12px; z-index: 2; height: 0;
    margin: -28px calc(var(--ie-pad) * -1 + 8px) 0;
  }
  .ie-dock {
    position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 16px; border: 1px solid var(--ie-line-2);
    background: color-mix(in srgb, var(--ie-surface-2) 88%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .45);
    color: var(--ie-text); font: inherit; text-align: start; cursor: pointer;
    transition: opacity .25s, transform .3s var(--ie-ease);
  }
  .ie-dock--off { opacity: 0; transform: translateY(8px); pointer-events: none; }
}
.ie-dock-label { font-size: 12px; color: var(--ie-muted); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container ie (max-width: 460px) {
  .ie-dock { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 0; }
  .ie-dock-label { grid-column: 1; grid-row: 1; }
  .ie-dock-price { grid-column: 1; grid-row: 2; text-align: start !important; }
  .ie-dock-go { grid-column: 2; grid-row: 1 / 3; align-self: center; }
}
.ie-dock-price {
  flex: 1; min-width: 0; text-align: end; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--ie-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ie-dock-go { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ie-btn-bg); color: var(--ie-btn-text); font-size: 14px; }

@container ie (max-width: 420px) {
  .ie-chip { padding: 8px 13px; font-size: 14px; min-height: 40px; }
  .ie-chips { gap: 8px; }
  .ie-form { gap: 24px; }
}

/* ---------- 7. Motion & contrast preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .ie *, .ie *::before, .ie *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .ie-chip-input:checked + .ie-chip, .ie-switch-input:checked + .ie-switch { outline: 2px solid Highlight; }
  .ie-price { color: CanvasText; background: none; }
}
