/* ============================================================
   DBR DEMO — styles (Insiteful brand)
   Self-contained: works standalone in the prototype and drops
   into the live site without fighting existing styles.
   ============================================================ */
.dbr {
  --dbr-noir: #172B36;
  --dbr-noir-deep: #0E1D26;
  --dbr-exped: #114C5A;
  --dbr-gold: #FFC801;
  --dbr-saffron: #FF9932;
  --dbr-powder: #F1F6F4;
  --dbr-mint-75: rgba(217, 232, 226, 0.75);
  --dbr-mint-60: rgba(217, 232, 226, 0.6);
  --dbr-mint-35: rgba(217, 232, 226, 0.35);
  --dbr-mint-12: rgba(217, 232, 226, 0.12);
  --dbr-gold-25: rgba(255, 200, 1, 0.28);
  font-family: 'Inter Tight', system-ui, sans-serif;
  color: var(--dbr-powder);
}

.dbr *, .dbr *::before, .dbr *::after { box-sizing: border-box; }

/* [hidden] must win over the explicit display values set below
   (display:grid/flex on an element otherwise defeats hidden) */
.dbr [hidden] { display: none !important; }

.dbr-shell {
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: stretch;
}
/* right column stacks phone + outcome card and fills the row height */
.dbr-col-phone { display: flex; flex-direction: column; min-height: 100%; }
@media (max-width: 900px) {
  .dbr-shell { grid-template-columns: 1fr; }
  .dbr-col-phone { min-height: 0; }
}

/* ---------- Intro / copy side ---------- */
.dbr-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--dbr-gold); margin-bottom: 18px;
}
.dbr-eyebrow::before {
  content: ""; width: 28px; height: 1.5px;
  background: linear-gradient(120deg, var(--dbr-gold), var(--dbr-saffron));
}
.dbr h2 {
  font-family: 'Noto Serif Display', Georgia, serif;
  font-weight: 300; font-stretch: 68%;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.05; margin: 0 0 16px;
}
.dbr h2 .dbr-grad {
  font-style: italic;
  background: linear-gradient(120deg, var(--dbr-gold), var(--dbr-saffron));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  /* keep the payoff phrase on one line so a single word never orphans */
  white-space: nowrap;
}
@media (max-width: 420px) {
  .dbr h2 .dbr-grad { white-space: normal; }
}
.dbr-lede { font-size: 1.05rem; line-height: 1.65; color: var(--dbr-mint-75); margin: 0 0 22px; max-width: 46ch; }
.dbr-note {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dbr-mint-35);
}

/* ---------- Setup form ---------- */
.dbr-setup { display: grid; gap: 14px; margin-top: 26px; max-width: 460px; }
.dbr-field { display: grid; gap: 7px; }
.dbr-field label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dbr-mint-60);
}
.dbr-field input, .dbr-field select {
  font-family: inherit; font-size: 1rem; color: var(--dbr-powder);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dbr-mint-12);
  border-radius: 12px; padding: 13px 15px; width: 100%;
  transition: border-color .2s, background .2s;
}
.dbr-field input:focus, .dbr-field select:focus {
  outline: none; border-color: var(--dbr-gold); background: rgba(255, 255, 255, 0.06);
}
.dbr-field input::placeholder { color: rgba(217, 232, 226, 0.3); }
.dbr-field select option { background: var(--dbr-noir-deep); color: var(--dbr-powder); }

.dbr-optional {
  font-size: 0.9em; letter-spacing: 0.08em; color: var(--dbr-mint-35);
  text-transform: none; font-style: italic;
}
.dbr-error {
  margin: 2px 0 0; padding: 11px 14px;
  border: 1px solid rgba(255, 153, 50, 0.35);
  background: rgba(255, 153, 50, 0.08);
  border-radius: 12px; font-size: 0.9rem; color: #FFB765;
}
.dbr-start:disabled { opacity: .65; cursor: wait; transform: none; }

.dbr-start {
  font-family: inherit; font-size: 1.02rem; font-weight: 600;
  background: var(--dbr-gold); color: var(--dbr-noir);
  border: none; border-radius: 999px; padding: 15px 30px;
  cursor: pointer; margin-top: 6px; justify-self: start;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform .2s, box-shadow .2s, background .2s;
  box-shadow: 0 12px 30px rgba(255, 200, 1, 0.18);
}
.dbr-start:hover { background: var(--dbr-saffron); transform: translateY(-2px); }

/* ---------- "Try it" chips (shown during the conversation) ---------- */
.dbr-tryit { margin-top: 30px; animation: dbr-in .4s ease-out; }
.dbr-tryit-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--dbr-gold); margin: 0 0 14px;
}
.dbr-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.dbr-chip {
  font-family: inherit; font-size: 0.88rem; color: var(--dbr-mint-75);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dbr-mint-12);
  border-radius: 999px; padding: 9px 16px; cursor: pointer;
  transition: border-color .2s, color .2s, background .2s, transform .2s;
}
.dbr-chip:hover {
  border-color: var(--dbr-gold); color: var(--dbr-gold);
  background: rgba(255, 200, 1, 0.06); transform: translateY(-1px);
}
.dbr-chip:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.dbr-tryit-foot {
  margin: 14px 0 0; font-size: 0.82rem; color: var(--dbr-mint-35);
}

/* ---------- Phone ---------- */
.dbr-phone {
  background: linear-gradient(170deg, #12242e, var(--dbr-noir-deep));
  border: 1px solid var(--dbr-mint-12);
  border-radius: 34px; padding: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  position: relative; overflow: hidden;
  flex: 1; display: flex; flex-direction: column;
}
.dbr-phone::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 200px at 80% -10%, rgba(17, 76, 90, 0.5), transparent 65%);
  pointer-events: none;
}
.dbr-phone-inner {
  background: var(--dbr-noir-deep);
  border-radius: 24px; overflow: hidden; position: relative;
  flex: 1; display: flex; flex-direction: column; min-height: 0;
}
.dbr-phone-bar {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 16px; border-bottom: 1px solid var(--dbr-mint-12);
  background: rgba(255, 255, 255, 0.02);
}
.dbr-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, var(--dbr-gold), var(--dbr-saffron));
  color: var(--dbr-noir); display: grid; place-items: center;
  font-weight: 700; font-size: 0.95rem;
}
.dbr-phone-meta { display: grid; gap: 2px; min-width: 0; }
.dbr-phone-meta strong { font-size: 0.95rem; font-weight: 600; }
.dbr-phone-meta span {
  font-size: 0.72rem; color: var(--dbr-mint-35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dbr-live {
  margin-left: auto; flex: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dbr-gold); display: inline-flex; align-items: center; gap: 6px;
}
.dbr-live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--dbr-gold); animation: dbr-pulse 1.8s infinite;
}
@keyframes dbr-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

.dbr-thread {
  flex: 1; min-height: 340px; max-height: 58vh; overflow-y: auto; padding: 18px 15px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin; scrollbar-color: var(--dbr-mint-12) transparent;
}

/* Idle state — shown until the first message arrives */
.dbr-idle {
  margin: auto; text-align: center; padding: 24px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.dbr-idle-icon {
  width: 54px; height: 54px; border-radius: 18px; flex: none;
  border: 1px solid var(--dbr-mint-12);
  background: rgba(255, 255, 255, 0.03);
  display: grid; place-items: center; color: var(--dbr-mint-35);
}
.dbr-idle-icon svg { width: 24px; height: 24px; }
.dbr-idle p {
  margin: 0; font-size: 0.88rem; line-height: 1.55;
  color: var(--dbr-mint-35); max-width: 24ch;
}
.dbr-thread::-webkit-scrollbar { width: 6px; }
.dbr-thread::-webkit-scrollbar-thumb { background: var(--dbr-mint-12); border-radius: 3px; }

.dbr-row { display: flex; flex-direction: column; gap: 4px; max-width: 84%; }
.dbr-row--agent { align-self: flex-start; align-items: flex-start; }
.dbr-row--visitor { align-self: flex-end; align-items: flex-end; }

.dbr-bubble {
  padding: 12px 15px; border-radius: 20px;
  font-size: 0.94rem; line-height: 1.5;
  display: flex; flex-direction: column;
  animation: dbr-in .28s ease-out;
  word-break: break-word;
}
@keyframes dbr-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.dbr-bubble--agent {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--dbr-mint-12);
  border-bottom-left-radius: 6px; color: var(--dbr-powder);
}
.dbr-bubble--visitor {
  background: var(--dbr-gold); color: var(--dbr-noir);
  border-bottom-right-radius: 6px; font-weight: 500;
}
.dbr-gap { height: 8px; }
.dbr-time {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.58rem; color: var(--dbr-mint-35); padding: 0 6px;
}

.dbr-typing { flex-direction: row; gap: 4px; padding: 14px 16px; }
.dbr-typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dbr-mint-60); display: block;
  animation: dbr-bounce 1.3s infinite;
}
.dbr-typing i:nth-child(2) { animation-delay: .18s; }
.dbr-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes dbr-bounce { 0%,60%,100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

.dbr-compose {
  display: flex; gap: 9px; padding: 13px 14px;
  border-top: 1px solid var(--dbr-mint-12);
  background: rgba(255, 255, 255, 0.02);
}
.dbr-compose input {
  flex: 1; font-family: inherit; font-size: 0.95rem; color: var(--dbr-powder);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--dbr-mint-12);
  border-radius: 999px; padding: 11px 17px; min-width: 0;
}
.dbr-compose input:focus { outline: none; border-color: var(--dbr-gold); }
.dbr-compose input::placeholder { color: rgba(217, 232, 226, 0.3); }
.dbr-compose input:disabled { opacity: .5; }
.dbr-compose button {
  flex: none; width: 43px; height: 43px; border-radius: 50%;
  background: var(--dbr-gold); color: var(--dbr-noir);
  border: none; cursor: pointer; display: grid; place-items: center;
  transition: background .2s, transform .2s;
}
.dbr-compose button:hover:not(:disabled) { background: var(--dbr-saffron); transform: scale(1.06); }
.dbr-compose button:disabled { opacity: .4; cursor: not-allowed; }
.dbr-compose button svg { width: 18px; height: 18px; }

/* ---------- Outcome card ---------- */
.dbr-outcome {
  margin-top: 16px; padding: 22px;
  border: 1px solid var(--dbr-gold-25);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 200, 1, 0.09), rgba(255, 153, 50, 0.03));
  animation: dbr-in .4s ease-out;
}
.dbr-outcome h3 {
  font-family: 'Noto Serif Display', Georgia, serif;
  font-weight: 300; font-stretch: 68%; font-size: 1.65rem;
  margin: 0 0 9px; display: flex; align-items: center; gap: 10px;
}
.dbr-outcome h3::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--dbr-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23172B36' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/13px no-repeat;
}
.dbr-outcome p { margin: 0 0 18px; font-size: 0.96rem; line-height: 1.6; color: var(--dbr-mint-75); }
/* Email capture inside the outcome card */
.dbr-capture { display: grid; gap: 9px; margin: 0 0 18px; }
.dbr-capture label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dbr-mint-60);
}
.dbr-capture-row { display: flex; gap: 9px; flex-wrap: wrap; }
.dbr-capture-row input {
  flex: 1; min-width: 190px; font-family: inherit; font-size: 0.98rem;
  color: var(--dbr-powder); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--dbr-mint-12); border-radius: 999px; padding: 12px 18px;
  transition: border-color .2s;
}
.dbr-capture-row input:focus { outline: none; border-color: var(--dbr-gold); }
.dbr-capture-row input::placeholder { color: rgba(217, 232, 226, 0.3); }
.dbr-capture-row button { flex: none; }
.dbr-capture-row button:disabled { opacity: .6; cursor: wait; transform: none; }
.dbr-capture-note { margin: 0; font-size: 0.78rem; color: var(--dbr-mint-35); line-height: 1.5; }
.dbr-capture-done {
  margin: 0 0 18px; padding: 12px 15px;
  border: 1px solid var(--dbr-gold-25); border-radius: 12px;
  background: rgba(255, 200, 1, 0.07);
  font-size: 0.92rem; color: var(--dbr-powder);
}

.dbr-outcome-actions { display: flex; flex-wrap: wrap; gap: 11px; }
.dbr-cta {
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  background: var(--dbr-gold); color: var(--dbr-noir);
  border: none; border-radius: 999px; padding: 13px 26px;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s, transform .2s;
}
.dbr-cta:hover { background: var(--dbr-saffron); transform: translateY(-2px); }
.dbr-cta--ghost {
  background: transparent; color: var(--dbr-powder);
  border: 1px solid var(--dbr-mint-12);
}
.dbr-cta--ghost:hover { background: transparent; border-color: var(--dbr-gold); color: var(--dbr-gold); }

.dbr-disclaimer {
  margin-top: 14px; text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--dbr-mint-35);
}
