/*
 * Exit-intent offer modal — cinematic dark panel + Old-Master painting.
 * Built from the "Exit Offer" handoff (mcds 11). Lifted from the standalone
 * demo; the demo backdrop, fallback .btn, and replay bar are dropped.
 *
 * Every var() carries a literal fallback so the modal themes correctly on any
 * marketing page regardless of which token sheet that page loads (same posture
 * as site-chrome.css). The dark panel hexes are intentional literals — this
 * surface is darker than the page tokens.
 *
 * Markup is injected by /js/exit-offer.js; nothing here renders until the
 * controller adds .is-open.
 */
.xo-back {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(12, 11, 9, 0.64); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: clamp(16px, 4vw, 32px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.42s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
.xo-back.is-open { opacity: 1; pointer-events: auto; }

.xo-modal {
  position: relative; width: min(940px, 100%);
  max-height: calc(100dvh - 40px); overflow: hidden;
  background: #1c1a16; border: 1px solid #3a3631;
  border-radius: var(--radius-card, 8px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  transform: translateY(18px); opacity: 0;
  transition: transform 0.5s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              opacity 0.5s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
.xo-back.is-open .xo-modal { transform: none; opacity: 1; }

/* No fixed min-height: let the offer panel set the height so the modal
   stays as short as its content and doesn't overflow into a scroll. The
   painting (object-fit: cover) fills whatever height the panel needs. */
.xo-grid { display: grid; grid-template-columns: 1.02fr 0.98fr; }

/* Last-resort escape hatch: only on genuinely short viewports (devtools
   open, tiny laptops) allow the panel to scroll instead of clipping the
   CTA. Normal desktop heights never hit this, so no scrollbar appears. */
@media (max-height: 600px) {
  .xo-modal { overflow-y: auto; }
}

/* painting */
.xo-art { position: relative; overflow: hidden; background: #100e0b; }
.xo-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xo-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(16, 14, 11, 0) 70%, rgba(28, 26, 22, 0.65) 100%),
    linear-gradient(180deg, rgba(16, 14, 11, 0.18) 0%, rgba(16, 14, 11, 0) 26%, rgba(16, 14, 11, 0) 60%, rgba(16, 14, 11, 0.5) 100%);
  box-shadow: inset -52px 0 70px -40px #1c1a16;
}
.xo-art-cap {
  position: absolute; left: 22px; bottom: 20px; z-index: 2;
  display: flex; gap: 12px; align-items: baseline;
  font-family: var(--font-mono, "Courier New", ui-monospace, monospace);
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.xo-art-cap .no { color: #c9a06a; }
.xo-art-cap .t  { color: #f4efe7; }

/* tear-off coupon seam */
.xo-seam { position: absolute; top: 0; bottom: 0; left: 0; width: 0; z-index: 3; pointer-events: none; }
.xo-seam::before, .xo-seam::after {
  content: ""; position: absolute; left: -11px; width: 22px; height: 22px;
  border-radius: 50%; background: #1c1a16; border: 1px solid #3a3631;
}
.xo-seam::before { top: -11px; }
.xo-seam::after  { bottom: -11px; }

.xo-close {
  position: absolute; top: 16px; right: 16px; z-index: 4;
  width: 36px; height: 36px; border-radius: var(--radius-btn, 4px);
  background: rgba(244, 239, 231, 0.07); border: 1px solid #3a3631; color: #c4bdb2;
  cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(6px);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.xo-close:hover { background: rgba(244, 239, 231, 0.14); color: #f4efe7; border-color: #5a554d; }

/* offer panel */
.xo-panel {
  position: relative; padding: clamp(34px, 3.2vw, 52px);
  display: flex; flex-direction: column; justify-content: center; gap: 26px; background: #1c1a16;
}
.xo-eye {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono, "Courier New", ui-monospace, monospace);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #b3aca1;
}
.xo-eye::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff6a1a; animation: xo-pulse 1.8s ease-in-out infinite; }

.xo-title {
  font-weight: 460; letter-spacing: -0.04em; line-height: 0.98; text-wrap: balance;
  font-size: clamp(38px, 4.4vw, 58px); color: #f4efe7; margin: 0;
}
.xo-title em { font-style: normal; color: #f0a35a; }
.xo-title .mut { color: #9b948a; }

/* coupon stub */
.xo-codebox { display: flex; flex-direction: column; gap: 0; flex: 0 0 auto; }
.xo-codebox-k {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono, "Courier New", ui-monospace, monospace);
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #8a847b;
  padding: 0 2px 10px;
}
.xo-code-row {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid #3a3631; border-radius: var(--radius-btn, 4px); overflow: hidden; background: #15130f;
}
.xo-code {
  flex: 1 1 auto; min-width: 0;
  height: 64px; line-height: 64px; white-space: nowrap; text-align: center;
  font-family: var(--font-mono, "Courier New", ui-monospace, monospace);
  font-size: clamp(24px, 2.7vw, 31px); font-weight: 700; letter-spacing: 0.2em;
  color: #f4efe7; padding: 0 16px; background: #15130f;
  user-select: all; overflow: hidden; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.xo-code .xo-ch { display: inline-block; color: inherit; padding: 0; border: 0; }
.xo-copybtn {
  flex: 0 0 auto; border: 0; border-left: 1px solid #3a3631;
  background: rgba(244, 239, 231, 0.08); color: #f4efe7;
  font-family: var(--font-mono, "Courier New", ui-monospace, monospace);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0 22px; cursor: pointer; transition: background 0.14s ease, color 0.14s ease;
}
.xo-copybtn:hover { background: rgba(244, 239, 231, 0.16); }
.xo-copybtn.is-done { background: #2eb678; color: #0e1a13; }

/* timer */
.xo-timer { display: flex; flex-direction: column; gap: 9px; }
.xo-timer-row {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-mono, "Courier New", ui-monospace, monospace);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8a847b;
}
.xo-timer-row::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: #ff6a1a; }
.xo-clock { color: #f4efe7; font-variant-numeric: tabular-nums; letter-spacing: 0.05em; margin-left: auto; }
.xo-track { height: 3px; border-radius: 2px; background: #2d2a24; overflow: hidden; }
.xo-track .fill { height: 100%; width: 100%; background: #b98a52; transition: width 0.9s linear; }

.xo-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 2px; }
.xo-actions .xo-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 56px; border: 0; border-radius: var(--radius-btn, 4px);
  background: #ff5600; color: #fff;
  font-family: var(--font-sans, "Inter", ui-sans-serif, system-ui, sans-serif);
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.12s ease;
}
.xo-actions .xo-cta:hover { background: #ff6a1a; }
.xo-actions .xo-cta[aria-busy="true"] { opacity: 0.75; cursor: progress; }
.xo-decline {
  align-self: center; background: none; border: 0; cursor: pointer; white-space: nowrap;
  font-family: var(--font-mono, "Courier New", ui-monospace, monospace);
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #6e6961; padding: 4px; transition: color 0.14s ease;
}
.xo-decline:hover { color: #c4bdb2; }

@media (max-width: 760px) {
  .xo-modal { width: min(440px, 100%); }
  .xo-grid { grid-template-columns: 1fr; min-height: 0; }
  .xo-art { aspect-ratio: 16 / 10; min-height: 190px; }
  .xo-seam::before, .xo-seam::after { display: none; }
}

/* toast */
.xo-toasts {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2200;
  display: grid; gap: 10px; width: min(380px, calc(100vw - 40px));
}
.xo-tx {
  background: var(--panel, #ffffff); border: 1px solid var(--line, #dedbd6);
  border-radius: var(--radius-card, 8px);
  box-shadow: var(--shadow-toast, 0 4px 24px rgba(0, 0, 0, 0.08)); padding: 13px 15px;
  display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start;
  animation: xo-tx-in 0.22s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
}
.xo-tx.is-out { animation: xo-tx-out 0.22s var(--ease-in, cubic-bezier(0.4, 0, 1, 1)) both; }
.xo-tx .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good, #067647); margin-top: 5px; }
.xo-tx .t { font-size: 13.5px; font-weight: 600; color: var(--ink, #111111); line-height: 1.35; }
.xo-tx .s { font-size: 12.5px; color: var(--muted, #7b7b78); margin-top: 2px; line-height: 1.45; }
.xo-tx .s b { font-family: var(--font-mono, "Courier New", ui-monospace, monospace); font-weight: 700; color: var(--ink, #111111); letter-spacing: 0.04em; }

@keyframes xo-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
@keyframes xo-tx-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes xo-tx-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .xo-back, .xo-modal, .xo-tx { transition: none !important; animation: none !important; }
  .xo-eye::before { animation: none !important; }
}
