/* Unifi AI Suite — widget styles. Scoped under .uai / #uai-* so nothing leaks into Elementor. */
:root {
  --uai-brand: #39B78E;
  --uai-dark: #1E1E1E;
  --uai-ink: #1a1f1d;
  --uai-muted: #66706c;
  --uai-line: #e3e8e6;
  --uai-bg: #ffffff;
  --uai-soft: #f4f8f6;
  --uai-danger: #d64545;
  --uai-radius: 16px;
  --uai-font: "Poppins", "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --uai-shadow: 0 12px 40px rgba(20, 40, 32, .14);
}

.uai, .uai *, #uai-chat-root, #uai-chat-root *, #uai-modal-root, #uai-modal-root * { box-sizing: border-box; }
.uai, #uai-chat-root, #uai-modal-root { font-family: var(--uai-font); color: var(--uai-ink); line-height: 1.5; font-size: 16px; }

/* ---------- Buttons ---------- */
.uai-btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  padding: 14px 24px; border-radius: 999px; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; line-height: 1.2;
}
.uai-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--uai-brand) 45%, transparent); outline-offset: 2px; }
.uai-btn-primary { background: var(--uai-brand); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--uai-brand) 35%, transparent); }
.uai-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px color-mix(in srgb, var(--uai-brand) 45%, transparent); }
.uai-btn-dark { background: var(--uai-dark); color: #fff; }
.uai-btn-dark:hover { transform: translateY(-1px); }
.uai-btn-ghost { background: transparent; color: var(--uai-ink); border: 1.5px solid var(--uai-line); }
.uai-btn-ghost:hover { border-color: var(--uai-brand); color: var(--uai-brand); }
.uai-btn-sm { padding: 9px 16px; font-size: 14px; }
.uai-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Card shell ---------- */
.uai-card {
  background: var(--uai-bg); border: 1px solid var(--uai-line); border-radius: var(--uai-radius);
  box-shadow: 0 4px 24px rgba(20, 40, 32, .06); overflow: hidden; max-width: 760px; margin: 0 auto; width: 100%; min-width: 0;
}
.uai { min-width: 0; max-width: 100%; }
.uai-card, .uai-chat-inline .uai-chat { contain: inline-size; }
.uai-card-head { padding: 26px 28px 8px; }
.uai-card-head h3 { margin: 0 0 6px; font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--uai-ink); }
.uai-card-head p { margin: 0; color: var(--uai-muted); font-size: 15px; }
.uai-card-body { padding: 16px 28px 28px; }
.uai-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--uai-brand); margin-bottom: 10px; }
.uai-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--uai-brand); }

/* ---------- Form fields ---------- */
.uai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.uai-field { display: flex; flex-direction: column; gap: 6px; }
.uai-field.uai-span { grid-column: 1 / -1; }
.uai-field label { font-size: 13.5px; font-weight: 600; color: var(--uai-ink); }
.uai-field small { color: var(--uai-muted); font-size: 12.5px; }
.uai-input, .uai-select, .uai-textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 12px 14px; border: 1.5px solid var(--uai-line); border-radius: 12px;
  background: #fff; color: var(--uai-ink); transition: border-color .15s, box-shadow .15s; min-height: 48px;
}
.uai-input:focus, .uai-select:focus, .uai-textarea:focus { outline: none; border-color: var(--uai-brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--uai-brand) 18%, transparent); }
.uai-input.uai-invalid { border-color: var(--uai-danger); }
.uai-prefix { position: relative; }
.uai-prefix .uai-input { padding-left: 30px; }
.uai-prefix::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--uai-muted); font-weight: 600; }
.uai-textarea { min-height: 96px; resize: vertical; }

.uai-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.uai-chip {
  border: 1.5px solid var(--uai-line); background: #fff; border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 14px; cursor: pointer;
  transition: all .15s; color: var(--uai-ink);
}
.uai-chip:hover { border-color: var(--uai-brand); }
.uai-chip.uai-on { background: var(--uai-brand); border-color: var(--uai-brand); color: #fff; }

.uai-range { width: 100%; accent-color: var(--uai-brand); }
.uai-range-val { font-weight: 700; color: var(--uai-brand); }

.uai-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.uai-note { font-size: 12.5px; color: var(--uai-muted); margin-top: 14px; }
.uai-error { color: var(--uai-danger); font-size: 13.5px; margin-top: 8px; }

/* ---------- Progress ---------- */
.uai-progress { height: 6px; background: var(--uai-soft); border-radius: 999px; overflow: hidden; margin: 0 28px; }
.uai-progress > i { display: block; height: 100%; background: var(--uai-brand); width: 0; transition: width .35s ease; border-radius: 999px; }
.uai-steps { display: flex; justify-content: space-between; font-size: 12px; color: var(--uai-muted); padding: 8px 28px 0; }

/* ---------- Result panel ---------- */
.uai-result { display: grid; gap: 14px; }
.uai-result-hero { background: linear-gradient(135deg, var(--uai-dark), color-mix(in srgb, var(--uai-dark) 70%, var(--uai-brand))); color: #fff; border-radius: 14px; padding: 22px 24px; position: relative; overflow: hidden; }
.uai-result-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: color-mix(in srgb, var(--uai-brand) 35%, transparent); filter: blur(10px); }
.uai-result-hero .uai-kicker { color: color-mix(in srgb, var(--uai-brand) 70%, #fff); }
.uai-result-hero .uai-kicker::before { background: currentColor; }
.uai-result-hero h4 { margin: 0 0 4px; font-size: 26px; line-height: 1.15; font-weight: 700; }
.uai-result-hero .uai-big { font-size: 34px; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.uai-result-hero p { margin: 8px 0 0; opacity: .9; font-size: 15px; }
.uai-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.uai-stat { background: var(--uai-soft); border-radius: 12px; padding: 12px 14px; }
.uai-stat b { display: block; font-size: 18px; color: var(--uai-ink); }
.uai-stat span { font-size: 12.5px; color: var(--uai-muted); }
.uai-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.uai-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.uai-list li::before { content: "✓"; color: var(--uai-brand); font-weight: 800; flex: none; }
.uai-list.uai-warn li::before { content: "•"; color: var(--uai-muted); }
.uai-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--uai-brand) 15%, #fff); color: var(--uai-brand); }
.uai-badge-muted { background: var(--uai-soft); color: var(--uai-muted); }

/* ---------- Product match cards ---------- */
.uai-matches { display: grid; gap: 10px; }
.uai-match { border: 1.5px solid var(--uai-line); border-radius: 14px; padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.uai-match.uai-best { border-color: var(--uai-brand); background: color-mix(in srgb, var(--uai-brand) 5%, #fff); }
.uai-match h5 { margin: 0; font-size: 16px; font-weight: 700; }
.uai-match p { margin: 0; font-size: 13.5px; color: var(--uai-muted); grid-column: 1 / -1; }
.uai-match .uai-range-txt { font-weight: 800; color: var(--uai-ink); white-space: nowrap; }

/* ---------- Calculator ---------- */
.uai-tabs { display: inline-flex; gap: 6px; background: var(--uai-soft); padding: 5px; border-radius: 999px; max-width: 100%; margin-bottom: 18px; }
.uai-tab { white-space: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.uai-tab { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 999px; cursor: pointer; color: var(--uai-muted); transition: all .15s; }
.uai-tab.uai-on { background: #fff; color: var(--uai-ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.uai-calc-out { margin-top: 20px; }
.uai-schedule { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 12px; }
.uai-schedule th, .uai-schedule td { padding: 8px 10px; border-bottom: 1px solid var(--uai-line); text-align: right; }
.uai-schedule th:first-child, .uai-schedule td:first-child { text-align: left; }
.uai-schedule th { color: var(--uai-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.uai-bar { height: 10px; border-radius: 999px; background: var(--uai-soft); overflow: hidden; display: flex; }
.uai-bar > i { display: block; height: 100%; }
.uai-legend { display: flex; gap: 16px; font-size: 13px; color: var(--uai-muted); margin-top: 8px; flex-wrap: wrap; }
.uai-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* ---------- Chat ---------- */
#uai-chat-root { position: fixed; z-index: 99998; bottom: 22px; right: 22px; }
#uai-chat-root.uai-left { right: auto; left: 22px; }
.uai-launcher {
  display: flex; align-items: center; gap: 10px; background: var(--uai-dark); color: #fff; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  padding: 12px 18px 12px 12px; border-radius: 999px; box-shadow: var(--uai-shadow); transition: transform .2s, box-shadow .2s;
}
.uai-launcher:hover { transform: translateY(-2px); }
.uai-launcher .uai-orb { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff 0, var(--uai-brand) 45%, color-mix(in srgb, var(--uai-brand) 60%, #000) 100%); position: relative; }
.uai-launcher .uai-orb::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--uai-brand) 60%, transparent); animation: uai-pulse 2.4s ease-out infinite; }
@keyframes uai-pulse { 0% { transform: scale(.8); opacity: .9 } 100% { transform: scale(1.5); opacity: 0 } }
.uai-launcher-dot { position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--uai-brand); border: 2px solid #fff; }

.uai-chat {
  width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 110px)); background: #fff; border-radius: 20px; box-shadow: var(--uai-shadow);
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--uai-line);
  transform-origin: bottom right; animation: uai-pop .22s ease-out;
}
#uai-chat-root.uai-left .uai-chat { transform-origin: bottom left; }
@keyframes uai-pop { from { transform: scale(.92) translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }
.uai-chat-inline .uai-chat { width: 100%; max-width: 720px; height: var(--uai-chat-h, 520px); margin: 0 auto; animation: none; }
.uai-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--uai-dark); color: #fff; }
.uai-chat-head .uai-orb { width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff 0, var(--uai-brand) 45%, color-mix(in srgb, var(--uai-brand) 60%, #000) 100%); flex: none; }
.uai-chat-head b { display: block; font-size: 15px; }
.uai-chat-head span { font-size: 12px; opacity: .75; display: flex; align-items: center; gap: 6px; }
.uai-chat-head span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5ee8a7; }
.uai-chat-close { margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; opacity: .8; padding: 4px 6px; }
.uai-chat-close:hover { opacity: 1; }
.uai-chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--uai-soft); scroll-behavior: smooth; }
.uai-msg { max-width: 86%; padding: 11px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; animation: uai-fade .2s ease-out; white-space: pre-line; }
@keyframes uai-fade { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
.uai-msg.uai-bot { background: #fff; border-bottom-left-radius: 4px; align-self: flex-start; border: 1px solid var(--uai-line); }
.uai-msg.uai-user { background: var(--uai-brand); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.uai-msg a { color: var(--uai-brand); font-weight: 600; }
.uai-msg.uai-user a { color: #fff; }
.uai-msg b { font-weight: 700; }
.uai-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.uai-typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9c3bf; animation: uai-bounce 1s infinite; }
.uai-typing i:nth-child(2) { animation-delay: .15s } .uai-typing i:nth-child(3) { animation-delay: .3s }
@keyframes uai-bounce { 0%, 60%, 100% { transform: translateY(0) } 30% { transform: translateY(-5px) } }
.uai-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; background: var(--uai-soft); }
.uai-quick .uai-chip { font-size: 13px; padding: 7px 12px; background: #fff; }
.uai-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--uai-line); background: #fff; }
.uai-chat-form input { flex: 1; font: inherit; font-size: 15px; padding: 11px 14px; border: 1.5px solid var(--uai-line); border-radius: 999px; min-width: 0; }
.uai-chat-form input:focus { outline: none; border-color: var(--uai-brand); }
.uai-chat-form button { border: 0; background: var(--uai-brand); color: #fff; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 18px; flex: none; display: grid; place-items: center; }
.uai-chat-foot { font-size: 11px; color: var(--uai-muted); text-align: center; padding: 0 12px 8px; background: #fff; }
.uai-msg .uai-mini-card { background: var(--uai-soft); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13.5px; }
.uai-msg .uai-mini-card b { display: block; font-size: 15px; }

/* ---------- Modal ---------- */
.uai-modal { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 16px; background: rgba(10, 20, 16, .55); backdrop-filter: blur(4px); animation: uai-fade .2s; }
.uai-modal-box { width: 100%; max-width: 760px; max-height: calc(100vh - 32px); overflow: auto; position: relative; border-radius: var(--uai-radius); }
.uai-modal-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: #fff; border: 1px solid var(--uai-line); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; }

/* ---------- Intake ---------- */
.uai-intake-q { font-size: 20px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.uai-intake-help { color: var(--uai-muted); font-size: 14px; margin: 0 0 16px; }
.uai-summary { display: grid; gap: 6px; font-size: 14.5px; }
.uai-summary div { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--uai-line); }
.uai-summary div span:first-child { color: var(--uai-muted); }
.uai-summary div button { justify-self: end; }
.uai-success { text-align: center; padding: 20px 0; }
.uai-success .uai-check { width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--uai-brand) 15%, #fff); color: var(--uai-brand); display: grid; place-items: center; font-size: 30px; margin: 0 auto 14px; font-weight: 800; }
.uai-success h4 { margin: 0 0 6px; font-size: 22px; }
.uai-success p { color: var(--uai-muted); margin: 0 0 16px; }
.uai-check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--uai-muted); }
.uai-check-row input { margin-top: 4px; accent-color: var(--uai-brand); width: 18px; height: 18px; flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .uai-grid { grid-template-columns: 1fr; }
  .uai-card-head, .uai-card-body { padding-left: 18px; padding-right: 18px; }
  .uai-progress { margin: 0 18px; }
  .uai-steps { padding: 8px 18px 0; }
  .uai-card-head h3 { font-size: 21px; }
  .uai-result-hero .uai-big { font-size: 28px; }
  .uai-summary div { grid-template-columns: 1fr auto; gap: 2px 10px; }
  .uai-summary div span:first-child { grid-column: 1 / -1; font-size: 12.5px; }
  #uai-chat-root { bottom: 14px; right: 14px; }
  #uai-chat-root.uai-left { left: 14px; }
  .uai-chat { height: min(640px, calc(100dvh - 90px)); }
  body.uai-has-sticky #uai-chat-root { bottom: 82px; }
}
@media (prefers-reduced-motion: reduce) {
  .uai *, #uai-chat-root *, #uai-modal-root * { animation: none !important; transition: none !important; }
}

/* ---------- Auto-placed sections (sit on the site's dark background) ---------- */
.uai-section { position: relative; z-index: 1; padding: 80px 20px; background: transparent; font-family: var(--uai-font); }
.uai-section-inner { max-width: 1140px; margin: 0 auto; }
.uai-section-head { text-align: center; max-width: 720px; margin: 0 auto 34px; }
.uai-section-head .uai-kicker { justify-content: center; display: flex; }
.uai-section-head h2 { margin: 0 0 12px; font-size: clamp(28px, 3.8vw, 44px); font-weight: 700; line-height: 1.12; letter-spacing: -.015em; color: #fff; }
.uai-section-head h2 em { font-style: normal; color: var(--uai-brand); }
.uai-section-head p { margin: 0; color: rgba(255,255,255,.66); font-size: 17px; }
.uai-section .uai-card { max-width: 860px; border-color: rgba(255,255,255,.08); box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04); }
.uai-nohead .uai-card-head { display: none; }
.uai-nohead .uai-card-body { padding-top: 28px; }
@media (max-width: 640px) { .uai-section { padding: 56px 16px; } }
