/* DIMG Lead Agent v2.4.0 (Sophie)
 * Styled with the DIMG brand: Montserrat, forest green, plum, and gold.
 * Brand colors live in the variables below. Everything is scoped under .dimga
 * so it will not affect the rest of the theme.
 */
.dimga {
  --dimga-green: #1F3D2B;     /* header, launcher, primary buttons */
  --dimga-plum: #9d395e;      /* visitor answers, progress, links */
  --dimga-gold: #eed68f;      /* icons, highlights, focus rings */
  --dimga-gold-soft: #faf3dd; /* recommended service panel */
  --dimga-black: #000000;     /* text */
  --dimga-white: #ffffff;
  --dimga-paper: #f6f6f3;     /* chat background, a warm off-white */
  --dimga-line: #e2e0d8;
  --dimga-muted: #55575a;
  --dimga-z: 99990;
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--dimga-black);
}
.dimga *, .dimga *::before, .dimga *::after { box-sizing: border-box; }
.dimga [hidden] { display: none !important; }
.dimga button, .dimga input, .dimga textarea { font: inherit; }

/* Launcher: one solid green card with a gold bulb, the bulb taken from the DIMG logo */
.dimga-dock {
  position: fixed; z-index: var(--dimga-z);
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  animation: dimga-rise .35s ease-out;
}
.dimga-launch {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--dimga-green); color: var(--dimga-white);
  border: 0; border-bottom: 3px solid var(--dimga-gold); border-radius: 4px;
  padding: 12px 18px 11px 12px; cursor: pointer;
  box-shadow: 0 10px 26px rgba(31, 61, 43, .28);
  transition: transform .15s ease;
}
.dimga-launch:hover { transform: translateY(-2px); }
.dimga-bulb {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--dimga-gold); color: var(--dimga-green);
  display: grid; place-items: center;
}
.dimga-launch-text strong { display: block; font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.dimga-launch-text small { display: block; font-size: 12px; font-weight: 500; color: var(--dimga-gold); }

/* Panel */
.dimga-panel {
  position: fixed; z-index: calc(var(--dimga-z) + 1);
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: min(390px, calc(100vw - 32px));
  height: min(630px, calc(100vh - 40px));
  height: min(630px, calc(100dvh - 40px));
  background: var(--dimga-white); border-radius: 6px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
  display: flex; flex-direction: column; overflow: hidden;
  animation: dimga-rise .25s ease-out;
}
.dimga-head { background: var(--dimga-green); color: var(--dimga-white); padding: 14px 14px 14px 16px; display: flex; align-items: center; gap: 12px; }
.dimga-head .dimga-bulb { width: 34px; height: 34px; }
.dimga-title { flex: 1; min-width: 0; }
.dimga-title strong { display: block; font-size: 14px; font-weight: 700; }
.dimga-title small { display: block; font-size: 12px; color: var(--dimga-gold); font-weight: 500; }
.dimga-x { background: none; border: 0; color: var(--dimga-white); font-size: 26px; line-height: 1; cursor: pointer; padding: 2px 6px; }

.dimga-track { height: 4px; background: var(--dimga-line); }
.dimga-progress { height: 100%; width: 0; background: var(--dimga-plum); transition: width .3s ease; }
.dimga-step { margin: 0; padding: 8px 16px 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dimga-plum); background: var(--dimga-paper); }

.dimga-log { flex: 1; overflow-y: auto; padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--dimga-paper); }
.dimga-msg { max-width: 88%; padding: 10px 14px; font-size: 14.5px; overflow-wrap: anywhere; border-radius: 4px; }
.dimga-bot { background: var(--dimga-white); color: var(--dimga-black); align-self: flex-start; border: 1px solid var(--dimga-line); }
.dimga-me { background: var(--dimga-plum); color: var(--dimga-white); align-self: flex-end; font-weight: 600; }

.dimga-dots { display: inline-flex; gap: 4px; }
.dimga-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--dimga-green); animation: dimga-b 1s infinite; }
.dimga-dots i:nth-child(2) { animation-delay: .15s; }
.dimga-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dimga-b { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@keyframes dimga-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Answer choices */
.dimga-choices { border-top: 1px solid var(--dimga-line); padding: 12px 16px 14px; display: grid; gap: 8px; max-height: 52%; overflow-y: auto; background: var(--dimga-white); }
.dimga-chip {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  text-align: left; background: var(--dimga-white); color: var(--dimga-black);
  border: 1.5px solid var(--dimga-black); border-radius: 4px;
  padding: 10px 14px; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .12s ease;
}
.dimga-chip::after { content: "\203A"; font-size: 18px; line-height: 1; color: var(--dimga-plum); }
.dimga-chip:hover { background: var(--dimga-gold); }
.dimga-again { border-style: dashed; }

/* Contact form */
.dimga-form { display: grid; gap: 9px; }
.dimga-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; color: var(--dimga-black); }
.dimga-field label span { font-weight: 400; color: var(--dimga-muted); }
.dimga-field input, .dimga-field textarea {
  width: 100%; padding: 10px; border: 1.5px solid var(--dimga-line); border-radius: 4px;
  background: var(--dimga-white); color: var(--dimga-black); font-size: 16px; /* 16px stops iOS zoom */
}
.dimga-field input:focus, .dimga-field textarea:focus { border-color: var(--dimga-green); }
.dimga-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dimga-submit { background: var(--dimga-green); color: var(--dimga-white); border: 0; border-bottom: 3px solid var(--dimga-gold); border-radius: 4px; padding: 12px; font-weight: 700; cursor: pointer; }
.dimga-submit:disabled { opacity: .7; cursor: default; }
.dimga-err { color: var(--dimga-plum); font-size: 13px; font-weight: 600; margin: 0; }
.dimga-fine { color: var(--dimga-muted); font-size: 11.5px; margin: 0; }

/* Plan card */
.dimga-plan { background: var(--dimga-white); border: 1px solid var(--dimga-line); border-radius: 4px; font-size: 14px; overflow: hidden; }
.dimga-eyebrow { margin: 0; padding: 12px 14px 0; background: var(--dimga-green); color: var(--dimga-gold); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.dimga-plan h3 { margin: 0; padding: 2px 14px 12px; background: var(--dimga-green); color: var(--dimga-white); font-size: 18px; font-weight: 800; line-height: 1.25; }
.dimga-meta { font-size: 12px; color: var(--dimga-muted); margin: 10px 14px; }
.dimga-plan ol { margin: 0 14px; padding-left: 18px; display: grid; gap: 8px; }
.dimga-plan ol li::marker { color: var(--dimga-plum); font-weight: 700; }
.dimga-fit { margin: 12px 14px 0; background: var(--dimga-gold-soft); border-left: 4px solid var(--dimga-gold); padding: 10px 12px; }
.dimga-fit span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--dimga-plum); }
.dimga-fit strong { display: block; margin: 2px 0 4px; font-weight: 700; }
.dimga-fit p { margin: 0; font-size: 13.5px; }
.dimga-close { margin: 12px 14px 10px; }
.dimga-ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 14px 14px; }
.dimga-btn { background: var(--dimga-green); color: var(--dimga-white) !important; text-decoration: none !important; border-radius: 4px; border-bottom: 3px solid var(--dimga-gold); padding: 9px 14px; font-weight: 700; }
.dimga-link { color: var(--dimga-plum) !important; font-weight: 600; font-size: 13.5px; }

.dimga button:focus-visible, .dimga a:focus-visible, .dimga input:focus-visible, .dimga textarea:focus-visible { outline: 3px solid var(--dimga-gold); outline-offset: 2px; }


/* Concierge additions */
.dimga-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dimga-subtle { border-color: var(--dimga-line); color: var(--dimga-muted); font-weight: 500; }
.dimga-subtle::after { content: ""; }
.dimga-askbox { display: flex; gap: 8px; }
.dimga-askbox input { flex: 1; min-width: 0; padding: 10px; border: 1.5px solid var(--dimga-green); border-radius: 4px; font-size: 16px; color: var(--dimga-black); background: var(--dimga-white); }
.dimga-askbox button { background: var(--dimga-green); color: var(--dimga-white); border: 0; border-radius: 4px; padding: 0 16px; font-weight: 700; cursor: pointer; }
.dimga-inline { display: inline-block; margin-top: 6px; color: var(--dimga-plum); font-weight: 700; text-decoration: none; }
.dimga-inline:hover { text-decoration: underline; }
.dimga-field textarea { resize: vertical; min-height: 70px; }
.dimga-optin { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--dimga-black); }
.dimga-optin input { margin-top: 2px; accent-color: var(--dimga-green); }
.dimga-cancel { background: none; border: 0; color: var(--dimga-muted); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 2px; }

/* Full service list */
.dimga-all { display: block; margin-top: 10px; font-size: 13.5px; }
.dimga-all strong { display: block; color: var(--dimga-green); font-weight: 700; }

/* After a visitor closes the concierge once, the launcher shrinks to the bulb */
.dimga-compact .dimga-launch { padding: 8px; border-radius: 50%; border-bottom-width: 0; box-shadow: 0 0 0 3px var(--dimga-gold), 0 8px 20px rgba(31, 61, 43, .25); }
.dimga-compact .dimga-launch-text { display: none; }

@media (max-width: 480px) {
  .dimga-panel { right: 0; bottom: 0; width: 100vw; height: 100%; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dimga-dock { right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .dimga-dots i, .dimga-dock, .dimga-panel { animation: none; }
  .dimga-launch, .dimga-progress { transition: none; }
}
@media print { .dimga { display: none; } }
