/* ============================================================================
   Compatibility "vibe check" design system — ported 1:1 from the reference
   React app (CompatibilityApp.jsx). Near-black canvas, pink→purple gradient.
   Shared by: the love funnel (compat_funnel), the full report (compatibility/
   report) and the in-app viral tool (compatibility/index). Class prefix `cx-`.
   ========================================================================== */

:root {
  --cx-bg:#070707; --cx-card:#0F0F0F; --cx-border:#1C1C1C;
  --cx-pink:#FF2D78; --cx-purple:#9333EA; --cx-green:#10B981;
  --cx-yellow:#EAB308; --cx-white:#FFFFFF; --cx-gray:#9CA3AF; --cx-dim:#4B5563;
}

/* hidden must always win, even over class display (flex screens toggle on it) */
.cx-app [hidden], [hidden].cx-wrap, [hidden].cx-loading { display:none !important; }

/* Full-screen takeover canvas */
.cx-app {
  background:var(--cx-bg); min-height:100vh; color:var(--cx-white);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
}
.cx-wrap { max-width:430px; margin:0 auto; padding:0 20px; }
.cx-pt { padding-top:40px; } .cx-pt-lg { padding-top:48px; }
.cx-pb { padding-bottom:72px; }

/* Back link */
.cx-back {
  display:inline-flex; align-items:center; gap:6px; color:var(--cx-dim);
  font-size:.82rem; text-decoration:none; padding:18px 0 4px; font-weight:500;
}
.cx-back:hover { color:var(--cx-gray); }

/* ---- Headings / section heads ------------------------------------------- */
.cx-eyebrow { font-size:.6rem; color:var(--cx-dim); letter-spacing:.2em; text-transform:uppercase; margin-bottom:10px; }
.cx-vibe { font-size:1.45rem; font-weight:800; margin:0 0 6px; letter-spacing:-.02em; }
.cx-opener { font-size:.9rem; color:var(--cx-gray); line-height:1.6; max-width:300px; margin:0 auto; }
.cx-shead { display:flex; align-items:center; gap:8px; margin-bottom:14px; }
.cx-shead .em { font-size:1rem; }
.cx-shead .lb { font-size:.57rem; color:var(--cx-dim); text-transform:uppercase; letter-spacing:.18em; font-weight:600; }
.cx-shead .ln { flex:1; height:1px; background:var(--cx-border); }
.cx-divider { height:1px; background:var(--cx-border); margin:22px 0; }
.cx-center { text-align:center; }

/* ---- Score ring --------------------------------------------------------- */
.cx-ring-wrap { position:relative; width:170px; height:170px; margin:0 auto; }
.cx-ring-wrap svg { transform:rotate(-90deg); }
.cx-ring-mid {
  position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
}
.cx-ring-num { font-size:2.4rem; font-weight:900; color:var(--cx-white); line-height:1; }
.cx-ring-lab { font-size:.52rem; color:var(--cx-dim); letter-spacing:.2em; text-transform:uppercase; margin-top:4px; }

/* ---- Who fell harder (obsession bar) ------------------------------------ */
.cx-obsbar { background:var(--cx-card); border:1px solid var(--cx-border); border-radius:14px; padding:18px 16px; }
.cx-obsbar-top { display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:14px; }
.cx-obsbar-side { text-align:center; flex:1; }
.cx-obsbar-pct { font-size:2.1rem; font-weight:900; line-height:1; color:#484848; transition:color .4s; }
.cx-obsbar-pct.win { color:var(--cx-pink); }
.cx-obsbar-name { font-size:.75rem; color:var(--cx-gray); margin:5px auto 0; max-width:80px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cx-obsbar-heart { font-size:1.4rem; margin-bottom:4px; flex-shrink:0; }
.cx-obsbar-track { height:8px; border-radius:4px; overflow:hidden; display:flex; }
.cx-obsbar-l { background:linear-gradient(90deg,#FF2D78,#FF6BA8); transition:width .05s linear; border-radius:4px 0 0 4px; width:50%; }
.cx-obsbar-r { flex:1; background:linear-gradient(90deg,#7C3AED,#9333EA); border-radius:0 4px 4px 0; }
.cx-obsbar-cap { margin:10px 0 0; font-size:.82rem; color:var(--cx-gray); line-height:1.6; text-align:center; font-style:italic; }

/* ---- Weirdly accurate cards --------------------------------------------- */
.cx-list { display:flex; flex-direction:column; gap:8px; }
.cx-weird { background:var(--cx-card); border:1px solid var(--cx-border); border-radius:12px; padding:12px 14px; display:flex; gap:10px; align-items:flex-start; }
.cx-weird .ar { color:var(--cx-pink); font-weight:700; flex-shrink:0; margin-top:1px; }
.cx-weird .tx { font-size:.88rem; color:var(--cx-gray); line-height:1.55; }
.cx-weird.locked { filter:blur(5px); user-select:none; }

/* ---- Score cards -------------------------------------------------------- */
.cx-score { background:var(--cx-card); border:1px solid var(--cx-border); border-radius:13px; padding:14px 16px; margin-bottom:10px; }
.cx-score-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.cx-score-left { display:flex; align-items:center; gap:8px; }
.cx-score-em { font-size:1.2rem; }
.cx-score-lb { font-size:.84rem; font-weight:700; color:var(--cx-white); }
.cx-score-pct { font-size:1.3rem; font-weight:900; }
.cx-score-desc { font-size:.75rem; color:var(--cx-gray); line-height:1.5; margin-bottom:9px; }
.cx-score-track { height:2px; background:#1A1A1A; border-radius:1px; overflow:hidden; }
.cx-score-fill { height:100%; width:0; border-radius:1px; transition:width 1s cubic-bezier(.4,0,.2,1); }

/* ---- Summary card ------------------------------------------------------- */
.cx-summary {
  background:linear-gradient(135deg,rgba(255,45,120,.08),rgba(147,51,234,.08));
  border:1px solid rgba(255,45,120,.2); border-radius:16px; padding:20px 18px; text-align:center;
}
.cx-summary .ic { font-size:1.4rem; margin-bottom:10px; }
.cx-summary .tx { font-size:.95rem; font-weight:600; color:rgba(255,255,255,.85); line-height:1.7; font-style:italic; margin:0; }

/* ---- Locked / upgrade panel --------------------------------------------- */
.cx-lock-wrap { position:relative; }
.cx-lock-over {
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:6px; text-align:center; padding:0 16px;
  background:linear-gradient(180deg,rgba(7,7,7,.2),rgba(7,7,7,.86) 60%);
  border-radius:14px;
}
.cx-lock-ic { font-size:1.5rem; }
.cx-lock-tx { font-size:.85rem; color:var(--cx-gray); max-width:240px; line-height:1.5; }

/* ---- Buttons ------------------------------------------------------------ */
.cx-grad-btn {
  background:linear-gradient(135deg,#FF2D78,#9333EA); color:#fff; border:none; border-radius:50px;
  padding:17px 32px; font-size:1rem; font-weight:700; cursor:pointer; width:100%;
  font-family:inherit; box-shadow:0 4px 24px rgba(255,45,120,.25); text-align:center; text-decoration:none; display:block;
}
.cx-grad-btn[disabled] { opacity:.35; cursor:not-allowed; }
.cx-ghost-btn {
  background:#0D0D0D; color:var(--cx-gray); border:1px solid var(--cx-border); border-radius:50px;
  padding:14px 32px; font-size:.93rem; font-weight:500; cursor:pointer; width:100%;
  font-family:inherit; text-align:center; text-decoration:none; display:block;
}
.cx-note { text-align:center; font-size:.72rem; color:var(--cx-dim); margin-top:10px; }
.cx-actions { display:flex; flex-direction:column; gap:10px; }

/* ---- Hero / feature chips (home) ---------------------------------------- */
.cx-hero { text-align:center; margin-bottom:32px; }
.cx-hero-em { font-size:2.8rem; margin-bottom:14px; display:inline-block; animation:cx-float 3s ease-in-out infinite; }
.cx-hero h1 { font-size:2.2rem; font-weight:900; line-height:1.08; margin:0 0 10px; letter-spacing:-.04em; }
.cx-grad-text { background:linear-gradient(135deg,#FF2D78,#9333EA); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.cx-hero p { color:var(--cx-gray); font-size:.9rem; line-height:1.6; margin:0 auto; max-width:240px; }
.cx-chips { display:flex; gap:6px; justify-content:center; flex-wrap:wrap; margin-bottom:28px; }
.cx-chip { background:#0D0D0D; border:1px solid var(--cx-border); border-radius:50px; padding:5px 12px; font-size:.72rem; color:var(--cx-dim); }

/* ---- Partner form blocks ------------------------------------------------ */
.cx-pblock-tag {
  display:inline-block; background:rgba(255,45,120,.1); border:1px solid rgba(255,45,120,.25);
  color:var(--cx-pink); font-size:.68rem; font-weight:700; letter-spacing:.08em;
  padding:5px 12px; border-radius:50px; margin-bottom:14px;
}
.cx-label { font-size:.6rem; color:var(--cx-dim); text-transform:uppercase; letter-spacing:.13em; display:block; margin-bottom:7px; }
.cx-input, .cx-select {
  background:#0D0D0D; border:1px solid #222; border-radius:11px; padding:14px 15px;
  font-size:.95rem; color:var(--cx-white); width:100%; box-sizing:border-box; font-family:inherit;
}
.cx-select { padding:13px 30px 13px 13px; -webkit-appearance:none; appearance:none; cursor:pointer; color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234B5563' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:calc(100% - 11px) center;
}
.cx-select:invalid { color:var(--cx-dim); }
.cx-select option { background:#151515; color:#fff; }
.cx-input::placeholder { color:#2A2A2A; }
.cx-input:focus, .cx-select:focus { border-color:var(--cx-pink); box-shadow:0 0 0 3px rgba(255,45,120,.1); outline:none; }
.cx-dob-grid { display:grid; grid-template-columns:1fr 1.5fr 1.2fr; gap:7px; }
.cx-gap { height:11px; } .cx-gap-lg { height:28px; }
.cx-split { display:flex; align-items:center; gap:12px; margin:20px 0; }
.cx-split .ln { flex:1; height:1px; background:var(--cx-border); }
.cx-split .hr { font-size:1.2rem; color:var(--cx-pink); animation:cx-pulse 2s ease infinite; }

/* ---- Loading ------------------------------------------------------------ */
.cx-loading { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:100vh; }
.cx-loading .em { font-size:3rem; margin-bottom:24px; animation:cx-bounce 1.2s ease infinite; }
.cx-loading .msg { font-size:1rem; color:var(--cx-gray); font-weight:500; animation:cx-pulse 1.5s ease infinite; }

/* ---- Animations --------------------------------------------------------- */
@keyframes cx-fadeUp { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
@keyframes cx-pulse  { 0%,100%{transform:scale(1)} 50%{transform:scale(1.13)} }
@keyframes cx-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-9px)} }
@keyframes cx-float  { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.cx-fade { animation:cx-fadeUp .5s ease both; }
.cx-fade-1 { animation:cx-fadeUp .5s ease .1s both; }
.cx-fade-2 { animation:cx-fadeUp .5s ease .2s both; }
.cx-fade-3 { animation:cx-fadeUp .5s ease .3s both; }
.cx-mb { margin-bottom:22px; } .cx-mb-lg { margin-bottom:28px; }

/* ---- "The Theory" subtle expandable ------------------------------------- */
.cx-theory { margin-top:18px; border-top:1px solid var(--cx-border); padding-top:14px; }
.cx-theory > summary { font-size:.72rem; color:var(--cx-dim); letter-spacing:.06em; cursor:pointer; list-style:none; font-weight:600; text-transform:uppercase; }
.cx-theory > summary::-webkit-details-marker { display:none; }
.cx-theory > summary::after { content:' ▾'; color:var(--cx-dim); }
.cx-theory[open] > summary::after { content:' ▴'; }
.cx-theory p { font-size:.78rem; color:var(--cx-gray); line-height:1.65; margin:10px 0 0; }

/* ---- Why it works / Why it doesn't (two-column) ------------------------- */
.cx-why { display:grid; grid-template-columns:1fr; gap:18px; }
.cx-why-yes .cx-why-item .ar { color:var(--cx-green); }
.cx-why-no  .cx-why-item .ar { color:var(--cx-yellow); }
.cx-why-yes { --cx-accent:var(--cx-green); }
.cx-why-yes .cx-why-item { border-color:rgba(16,185,129,.25); }
.cx-why-no  .cx-why-item { border-color:rgba(234,179,8,.22); }
@media (min-width:560px) { .cx-why { grid-template-columns:1fr 1fr; gap:16px; } }

/* ---- Desktop: lay the two partners side by side (P1 | ♥ | P2) ---------- */
@media (min-width:820px) {
  .cx-form-wide { max-width:800px; }
  .cx-partners { display:grid; grid-template-columns:1fr auto 1fr; gap:34px; align-items:stretch; }
  .cx-partners .cx-split-heart { flex-direction:column; margin:0; align-self:stretch; gap:14px; }
  .cx-partners .cx-split-heart .ln { width:1px; height:auto; flex:1; }
  .cx-form-foot { max-width:520px; margin:0 auto; }
}
