/* ==========================================================================
   Klingfirm public site. Loaded last on base.html pages, after nx.css.
   Floating capsule header, a phone-framed price card in the hero, big rounded
   cards for every section. Only restyles: ids and classes the scripts use are
   unchanged.
   ========================================================================== */

/* ---------- header: a floating capsule ---------- */
.site-header, html[data-theme] .site-header {
  position: sticky; top: 12px; z-index: 80; background: transparent !important; border: 0 !important;
  box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0 16px;
}
.site-header .nav {
  max-width: 1240px; margin: 12px auto 0; min-height: 72px; padding: 10px 10px 10px 18px;
  border-radius: 999px; background: rgba(18, 20, 16, .82); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
}
.site-header.scrolled .nav { box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .8); }
.site-header .brand { gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; }
.site-header .brand small { display: none; }
.site-header .brand-mark { width: 42px; height: 42px; border-radius: 50% !important; display: grid; place-items: center; }
.site-header .brand-mark svg { width: 22px; height: 22px; }
.site-header .nav-links { gap: 4px; }
.site-header .nav-links a { padding: .55rem .95rem; border-radius: 999px; font-weight: 600; font-size: .98rem; }
.site-header .nav-links a::after { display: none; }
.site-header .nav-links a:hover { background: var(--night-2); }
.site-header .nav-links a.active { background: var(--night-3); color: var(--ink); }
.site-header .nav-actions .btn { min-height: 50px; padding: 0 1.3rem; }
.site-header .nav-toggle { width: 50px; height: 50px; border-radius: 50%; background: var(--night-2); color: var(--ink); border: 1px solid var(--border); }
.topbar-util { display: none !important; }
.site-ticker, .site-banner, .comp-strip { border-radius: 0; }

/* ---------- section rhythm ---------- */
main > .section, .section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section-soft, .section-alt { background: transparent; }
.section-head h2, h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -.035em; line-height: 1.04; }
.section-head .lede { font-size: 1.1rem; }

/* ---------- hero ---------- */
.kx-hero { padding: clamp(2rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem); }
.kx-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.kx-tag { display: inline-flex; align-items: center; gap: .55rem; height: 40px; padding: 0 1rem 0 .55rem; border-radius: 999px; background: var(--night-1); border: 1px solid var(--border); color: #c3c8bb; font-weight: 600; font-size: .92rem; }
.kx-tag i { width: 26px; height: 26px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(198, 243, 107, .12); }
.kx-hero h1 { font-size: clamp(3.2rem, 8.4vw, 7.2rem); line-height: .96; letter-spacing: -.05em; font-weight: 800; margin: 1.4rem 0 1.4rem; }
.kx-hero h1 .line2 { display: block; }
.kx-hero h1 mark {
  background: none; color: var(--lime); padding: 0; margin: 0;
}
.kx-hero .lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 34em; color: #a9afa2; }
.kx-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 2rem 0 1.2rem; }
.kx-cta .btn-lg { min-height: 64px; padding: 0 1.8rem; font-size: 1.08rem; }
.kx-cta .hc-free { text-decoration: none; }
.kx-fine { max-width: 34em; }

/* the price card lives in a phone frame */
.kx-phone {
  position: relative; justify-self: center; width: min(420px, 100%);
  padding: 58px 18px 18px; border-radius: 54px;
  background: linear-gradient(170deg, #1b1f17, #0e100c 60%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 0 0 10px #0b0d09, 0 0 0 11px rgba(255, 255, 255, .06), 0 60px 120px -40px rgba(120, 170, 50, .35);
}
.kx-phone::before { content: ""; position: absolute; inset: -30% -20% auto; height: 70%; background: radial-gradient(closest-side, rgba(198, 243, 107, .14), transparent); pointer-events: none; z-index: -1; }
.kx-phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 120px; height: 30px; border-radius: 999px; background: #000; }
.kx-buy, .hc-buy.kx-buy { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; animation: none; }
.kx-buy-label { color: var(--muted); font-size: .9rem; margin: 0 0 8px 4px; }
.kx-buy .hc-seg { gap: 8px; margin-bottom: 14px; }
.kx-buy .hc-thumb { background: var(--lime); border-radius: 999px; }
.kx-buy .hc-chip { min-height: 48px; border-radius: 999px; background: var(--night-2); color: #c3c8bb; font: 600 .95rem var(--font); }
.kx-buy .hc-chip:hover { background: var(--night-3); }
.kx-buy .hc-chip.on, .kx-buy .hc-chip.on:hover { background: transparent; color: var(--lime-ink); }
.kx-buy .hc-chip.on.off { color: var(--lime-ink); }
.kx-buy .kx-sizes .hc-chip { font-size: .85rem; }
.kx-buy .hc-price { display: flex; flex-direction: column; gap: 4px; margin: 6px 4px 16px; }
.kx-buy .hc-price strong { font: 700 clamp(3rem, 6vw, 4rem)/1 var(--font-head); letter-spacing: -.045em; color: var(--ink); }
.kx-buy .hc-price span { color: var(--muted); }
.kx-rows, .kx-buy .hc-mini { display: flex !important; flex-direction: column; gap: 0; margin: 4px 4px 12px; padding: 0 !important; border: 0 !important; background: none !important; }
.kx-rows > div { display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border); }
.kx-rows > div:last-child { border-bottom: 0; }
.kx-rows span { color: var(--muted); font-size: .98rem; }
.kx-rows b { color: var(--ink); font-size: 1.05rem; font-weight: 650; }
.kx-buy .hc-info { color: var(--muted); margin: 0 4px 14px; }
.kx-buy .btn-lg { min-height: 64px; font-size: 1.08rem; border-radius: 999px; }

/* stats strip: big numbers in separate rounded tiles */
.hc-stats { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: clamp(2.4rem, 5vw, 4rem); border: 0 !important; padding: 0 !important; }
.hc-stats > div { background: var(--night-1); border: 1px solid var(--border); border-radius: 28px; padding: 22px 22px 20px; color: var(--muted); font-size: .95rem; display: flex; flex-direction: column; gap: 6px; }
.hc-stats strong { color: var(--ink); font: 700 clamp(1.8rem, 3vw, 2.4rem)/1 var(--font-head); letter-spacing: -.03em; }
.hc-stats a { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }

/* ---------- section cards ---------- */
.hc-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hc-col { background: var(--night-1); border: 1px solid var(--border); border-radius: 32px; padding: 28px; min-height: 240px; display: flex; flex-direction: column; justify-content: flex-end; }
.hc-col h3 { font-size: 1.45rem; margin: 0 0 .5rem; }
.hc-col p { color: var(--muted); margin: 0; }
.hc-cols.numbered { counter-reset: kx; }
.hc-cols.numbered .hc-col { position: relative; }
.hc-cols.numbered .hc-col::before {
  counter-increment: kx; content: counter(kx, decimal-leading-zero);
  position: absolute; top: 24px; left: 28px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--night-3); color: var(--ink); font: 700 1rem var(--font-head);
}
.hc-cols.numbered .hc-col:first-child::before { background: var(--lime); color: var(--lime-ink); }
.hc-line .section-head h2 mark { color: var(--lime); background: none; }

.hc-sim-card { border-radius: 36px !important; padding: clamp(22px, 4vw, 40px) !important; }
.hc-sim-num { font-family: var(--font-head); letter-spacing: -.04em; color: var(--ink); }
.hc-range { accent-color: var(--lime); }
.hc-verdict.ok { background: rgba(198, 243, 107, .1); color: var(--text); border-color: rgba(198, 243, 107, .3); }

.hc-end { padding: clamp(2rem, 5vw, 4rem) 0 clamp(4rem, 8vw, 7rem); background: transparent; }
.hc-end .container {
  background: var(--lime); color: var(--lime-ink); border-radius: 44px; padding: clamp(32px, 6vw, 72px);
  display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between;
}
.hc-end h2 { color: var(--lime-ink); margin: 0; font-size: clamp(2.6rem, 6vw, 5rem); line-height: .98; letter-spacing: -.05em; }
.hc-end h2 mark { background: none; color: inherit; padding: 0; }
.hc-end h2 .line2 { display: block; }
.hc-end .btn-primary { background: var(--lime-ink); border-color: var(--lime-ink); color: var(--lime); min-height: 64px; padding: 0 1.8rem; }
.hc-end .btn-primary:hover { background: #000; color: var(--lime); }

/* ---------- inner pages: tables and cards keep the same shape ---------- */
.hero { padding: clamp(2.4rem, 6vw, 5rem) 0 clamp(1.6rem, 3vw, 2.4rem); }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.2rem); line-height: 1; letter-spacing: -.045em; }
.card, .panel { border-radius: 32px; }

/* ---------- footer ---------- */
.site-footer { background: transparent; border-top: 0; }
.site-footer > .container { background: var(--night-1); border: 1px solid var(--border); border-radius: 40px; padding: clamp(24px, 4vw, 48px); margin-bottom: 24px; }
.site-footer .brand small { display: none; }

/* ---------- phone ---------- */
@media (max-width: 900px) {
  .kx-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .kx-phone { width: min(400px, 100%); }
  .hc-cols { grid-template-columns: minmax(0, 1fr); }
  .hc-col { min-height: 200px; }
}
@media (max-width: 640px) {
  .site-header { top: 8px; padding: 0 10px; }
  .site-header .nav { min-height: 64px; padding: 7px 7px 7px 12px; margin-top: 8px; }
  .site-header .brand-mark { width: 38px; height: 38px; }
  .kx-hero h1 { font-size: clamp(3rem, 15vw, 4.4rem); }
  .kx-cta .btn-lg { flex: 1 1 100%; justify-content: center; }
  .kx-phone { padding: 52px 12px 14px; border-radius: 46px; }
  .hc-stats { grid-template-columns: 1fr 1fr; }
}

/* fixes after the first screenshots */
.hc-cols.numbered .hc-col h3::before { content: none; }
.hc-line .hc-col { border-top: 1px solid var(--border); }
.hc-end h2 { text-transform: none; }
.hc-track { background: var(--night-3); }
.hc-fill.ok { background: var(--lime); }
.hc-fill.warn { background: #f2c14e; }
.hc-fill.bad { background: var(--loss); }
.hc-fill.goal { background: #e3e6de; }

/* ==========================================================================
   Payment pages (pay.css) on the night theme. Only client pages (.pay);
   the agent desk and the CRM control room keep their light look.
   ========================================================================== */
html[data-theme] .pay {
  --p-paper: var(--night-0, #090b08);
  --p-paper-2: var(--night-2, #191c17);
  --p-card: var(--night-1, #121410);
  --p-ink: #f3f5ef;
  --p-ink-2: #d5d9cf;
  --p-grey: #8f9689;
  --p-grey-2: #646a60;
  --p-line: rgba(255, 255, 255, .08);
  --p-line-2: rgba(255, 255, 255, .14);
  --p-red: #ff6b6b;
  --p-red-soft: rgba(255, 107, 107, .12);
  --p-lime: var(--lime, #c6f36b);
  --p-green: var(--lime, #c6f36b);
  --p-green-soft: rgba(198, 243, 107, .1);
  --p-gold: #f2c14e;
  --p-cream: rgba(242, 193, 78, .12);
  --p-amber: #f2c14e;
  --p-amber-soft: rgba(242, 193, 78, .1);
  --p-shadow: 0 20px 40px -28px rgba(0, 0, 0, .9);
  --p-shadow-sm: 0 10px 20px -14px rgba(0, 0, 0, .8);
  --pdark: #1b1f18;
  font-family: inherit;
  background: radial-gradient(50rem 24rem at 80% -8%, rgba(198, 243, 107, .08), transparent 60%), var(--night-0, #090b08);
}
html[data-theme] .pay::after { display: none; }
html[data-theme] .pay-card, html[data-theme] .pay-ticket { background: var(--night-1, #121410); border-color: var(--p-line); }
html[data-theme] .pay-card--flat { background: rgba(255, 255, 255, .03); }
html[data-theme] .pay-tag--soft, html[data-theme] .pay .input, html[data-theme] .pay select, html[data-theme] .pay textarea, html[data-theme] .pay-method-body, html[data-theme] .pay-platform-body, html[data-theme] .pay-channel, html[data-theme] .pay-chip, html[data-theme] .pay .btn-ghost, html[data-theme] .pay-upload { background-color: var(--night-2, #191c17); color: var(--p-ink); border-color: var(--p-line-2); }
html[data-theme] .pay select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6f36b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; }
html[data-theme] .pay-method input:checked + .pay-method-body, html[data-theme] .pay-platform input:checked + .pay-platform-body { background: rgba(198, 243, 107, .07); border-color: var(--lime, #c6f36b); box-shadow: 0 0 0 3px rgba(198, 243, 107, .12); }
html[data-theme] .pay-method input:checked + .pay-method-body .pay-method-dot { background: var(--lime, #c6f36b); border-color: var(--lime, #c6f36b); }
/* places that used ink as a dark surface */
html[data-theme] .pay-tag--ink, html[data-theme] .pay-tile--ink, html[data-theme] .pay-bar, html[data-theme] .pay .split-pay, html[data-theme] .pay-total { background: var(--pdark); color: #fff; border: 1px solid var(--p-line-2); }
html[data-theme] .pay-tag--ink, html[data-theme] .pay-tile--ink { color: var(--p-lime); }
html[data-theme] .pay-tag--lime, html[data-theme] .pay-tile--lime, html[data-theme] .pay-badge, html[data-theme] .pay-dial a { color: var(--lime-ink, #10140a); }
html[data-theme] .pay .btn-primary { background: var(--lime, #c6f36b); border-color: var(--lime, #c6f36b); color: var(--lime-ink, #10140a); }
html[data-theme] .pay .btn-primary:hover { background: var(--lime-deep, #b2e04f); border-color: var(--lime-deep, #b2e04f); color: var(--lime-ink, #10140a); }
html[data-theme] .pay .btn-ink { background: var(--pdark); border-color: var(--p-line-2); color: #fff; }
html[data-theme] .pay .btn-ghost:hover, html[data-theme] .pay-chip:hover { background: var(--lime, #c6f36b); border-color: var(--lime, #c6f36b); color: var(--lime-ink, #10140a); }
html[data-theme] .pay .btn-quiet:hover { background: rgba(255, 255, 255, .06); }
html[data-theme] .pay-qr-frame { background: #fff; }            /* QR codes need a white quiet zone */
html[data-theme] .pay-note--warn { border-color: rgba(242, 193, 78, .3); }
html[data-theme] .pay-note--good, html[data-theme] .pay-status--good { border-color: rgba(198, 243, 107, .3); }
html[data-theme] .pay-note--bad, html[data-theme] .pay-status--bad { border-color: rgba(255, 107, 107, .3); }
html[data-theme] .pay-title, html[data-theme] .pay h1, html[data-theme] .pay h2, html[data-theme] .pay h3 { color: var(--p-ink); }
html[data-theme] .pay-tag { background: rgba(198, 243, 107, .12); color: var(--lime, #c6f36b); box-shadow: none; }
html[data-theme] .pay .accent { color: var(--lime, #c6f36b); }
