/* Mohave Solar — corner chat widget + free-estimate popup
   (same pattern as the Its Bin Cleaned engagement widgets, restyled to the
   Mohave palette defined in main.css). */

/* ---------- popup modal ---------- */
.ms-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ms-modal[hidden] { display: none; }
.ms-modal-backdrop { position: absolute; inset: 0; background: rgba(12, 43, 82, 0.72); backdrop-filter: blur(3px); }
.ms-modal-card { position: relative; z-index: 2; background: #fff; border-radius: 22px; box-shadow: 0 24px 70px rgba(12, 43, 82, 0.35); max-width: 480px; width: 100%; padding: 44px 38px 36px; text-align: center; animation: msPop 0.28s ease; }
@keyframes msPop { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
.ms-modal-x { position: absolute; top: 12px; right: 16px; background: none; border: 0; font-size: 1.9rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 6px; }
.ms-modal-x:hover { color: var(--navy); }
.ms-modal-flag { display: inline-block; background: rgba(246, 160, 27, 0.16); color: var(--orange-deep); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; padding: 6px 16px; border-radius: 999px; margin-bottom: 14px; font-family: var(--font-head); }
.ms-modal-flag.ok { background: rgba(86, 185, 71, 0.14); color: #3d8c31; }
.ms-modal-card h3 { font-size: 1.75rem; line-height: 1.12; margin-bottom: 10px; color: var(--navy); }
.ms-modal-card p { color: var(--muted); font-size: 0.97rem; margin-bottom: 18px; }
.ms-offer-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 6px; }
.ms-offer-names { display: flex; gap: 10px; }
.ms-offer-names input { flex: 1; min-width: 0; text-align: center; }
.ms-offer-form input { padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 12px; font-family: inherit; font-size: 1rem; background: #fdfbf7; text-align: center; }
.ms-offer-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27, 92, 171, 0.15); }
.ms-hp { position: absolute; left: -9999px; }
.ms-modal-fine { font-size: 0.76rem; color: var(--muted); margin-top: 8px; margin-bottom: 0; }
.ms-offer-err { color: #c0392b; font-weight: 600; font-size: 0.9rem; }
@media (max-width: 560px) { .ms-modal-card { padding: 36px 22px 28px; } }

/* ---------- corner chat widget ---------- */
.ms-chat { position: fixed; right: 22px; bottom: 22px; z-index: 150; font-family: var(--font-body); }
.ms-chat-bubble { position: relative; width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 28px rgba(12, 43, 82, 0.35); transition: transform 0.18s, box-shadow 0.18s; }
.ms-chat-bubble:hover { transform: scale(1.07); }
.ms-chat-bubble svg { width: 28px; height: 28px; fill: #fff; }
.ms-chat-bubble .ic-close { display: none; }
.ms-chat.open .ms-chat-bubble .ic-chat { display: none; }
.ms-chat.open .ms-chat-bubble .ic-close { display: block; }
.ms-chat-dot { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--orange); border: 2.5px solid #fff; opacity: 0; transform: scale(0.4); transition: 0.25s; }
.ms-chat.nudge .ms-chat-dot { opacity: 1; transform: scale(1); }
@keyframes msChatBounce { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } 60% { transform: translateY(-3px); } }
.ms-chat.nudge .ms-chat-bubble { animation: msChatBounce 1.1s ease 2; }
.ms-chat-panel { position: absolute; right: 0; bottom: 78px; width: 360px; max-width: calc(100vw - 32px); background: #fff; border-radius: 20px; box-shadow: 0 24px 70px rgba(12, 43, 82, 0.35); overflow: hidden; display: flex; flex-direction: column; max-height: min(560px, calc(100vh - 130px)); animation: msPop 0.22s ease; }
.ms-chat-panel[hidden] { display: none; }
.ms-chat-head { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, var(--navy), var(--blue-dark)); color: #fff; padding: 16px 18px; }
.ms-chat-head img { height: 38px; width: auto; background: #fff; border-radius: 10px; padding: 3px; }
.ms-chat-head strong { display: block; font-size: 1rem; line-height: 1.15; font-family: var(--font-head); }
.ms-chat-head span { font-size: 0.76rem; color: #a9c6e8; display: flex; align-items: center; gap: 6px; }
.ms-chat-head span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4caf50; }
.ms-chat-x { margin-left: auto; background: none; border: 0; color: #a9c6e8; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 4px; }
.ms-chat-x:hover { color: #fff; }
.ms-chat-body { padding: 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; background: var(--sand); }
.ms-msg { max-width: 85%; padding: 11px 14px; border-radius: 16px; font-size: 0.92rem; line-height: 1.5; }
.ms-msg.bot { background: #fff; color: var(--ink); border-bottom-left-radius: 6px; box-shadow: 0 3px 12px rgba(12, 43, 82, 0.08); align-self: flex-start; }
.ms-msg.user { background: var(--blue); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.ms-msg .btn { margin-top: 8px; padding: 9px 18px; font-size: 0.85rem; }
.ms-msg a { color: var(--blue); font-weight: 600; }
.ms-typing { display: inline-flex; gap: 5px; padding: 13px 16px; background: #fff; border-radius: 16px; border-bottom-left-radius: 6px; box-shadow: 0 3px 12px rgba(12, 43, 82, 0.08); align-self: flex-start; }
.ms-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: 0.5; animation: msTy 1s infinite; }
.ms-typing i:nth-child(2) { animation-delay: 0.18s; }
.ms-typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes msTy { 0%, 100% { transform: translateY(0); opacity: 0.4; } 45% { transform: translateY(-5px); opacity: 1; } }
.ms-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; background: #fff; border-top: 1px solid var(--line); }
.ms-chip { border: 1.5px solid var(--line); background: var(--sand); color: var(--navy); font-weight: 700; font-size: 0.82rem; padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: 0.15s; font-family: var(--font-head); }
.ms-chip:hover { border-color: var(--blue); color: var(--blue-dark); }
.ms-chip.primary { background: linear-gradient(135deg, var(--gold), var(--orange)); border-color: var(--orange); color: var(--navy); }
.ms-chip.primary:hover { background: var(--orange); }
.ms-chat-inputrow { display: flex; gap: 8px; width: 100%; }
.ms-chat-inputrow input { flex: 1; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-family: inherit; font-size: 0.92rem; background: #fdfbf7; }
.ms-chat-inputrow input:focus { outline: none; border-color: var(--blue); }
.ms-chat-inputrow .btn { padding: 0 18px; border-radius: 999px; font-size: 1rem; }
.ms-chat-teaser { position: absolute; right: 0; bottom: 76px; width: 240px; background: #fff; border-radius: 16px; border-bottom-right-radius: 6px; box-shadow: 0 14px 40px rgba(12, 43, 82, 0.30); padding: 14px 16px; font-size: 0.88rem; line-height: 1.45; color: var(--ink); cursor: pointer; animation: msPop 0.25s ease; }
.ms-chat-teaser b { color: var(--navy); }
.ms-teaser-x { position: absolute; top: 4px; right: 8px; background: none; border: 0; color: var(--muted); font-size: 1.15rem; cursor: pointer; padding: 2px; }
.ms-teaser-x:hover { color: var(--ink); }
@media (max-width: 640px) {
  .ms-chat { right: 14px; bottom: 14px; }
  .ms-chat-panel { bottom: 74px; }
}
