/* ==========================================================
   Checkout público FyrenPay (/pay, /l)
   ========================================================== */
:root {
  --bg: #0b0705;
  --text: #fff6ef;
  --muted: #b3a092;
  --faint: #806e62;
  --line: rgba(255, 170, 110, .12);
  --line-2: rgba(255, 170, 110, .26);
  --o1: #ffb347;
  --o2: #ff7a1a;
  --ok: #4ade80;
  --bad: #f87171;
  --grad: linear-gradient(135deg, #ffb347 0%, #ff7a1a 45%, #e84d0a 100%);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Syne", "Outfit", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body.ck-body {
  margin: 0; min-height: 100svh;
  display: flex; flex-direction: column;
  font-family: var(--font); color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: var(--o1); }
.ck-glow { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; }
.ck-glow.a { width: 560px; height: 560px; right: -160px; top: -200px; background: rgba(255, 106, 26, .22); }
.ck-glow.b { width: 480px; height: 480px; left: -200px; bottom: -200px; background: rgba(232, 77, 10, .12); }

/* Topo */
.ck-top { position: relative; z-index: 1; width: min(1060px, 100% - 32px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0 8px; }
.ck-brand img { margin-right: 10px; }
.ck-brand { display: inline-flex; align-items: center; gap: 0; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.ck-brand img { border-radius: 9px; }
.brand-fyren { color: #fff; }
.brand-pay { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ck-secure { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #a7f3c0; background: rgba(74, 222, 128, .08); border: 1px solid rgba(74, 222, 128, .22); }

.ck-demo { position: relative; z-index: 1; width: min(1060px, 100% - 32px); margin: 8px auto 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; color: #ffd08a; background: rgba(255, 193, 74, .08); border: 1px dashed rgba(255, 193, 74, .35); }
.ck-demo span { display: flex; gap: 6px; }
.ck-demo a { padding: 3px 10px; border-radius: 8px; background: rgba(255, 193, 74, .12); color: #ffd08a; text-decoration: none; font-size: 12px; }

/* Grade */
.ck-main {
  position: relative; z-index: 1; flex: 1;
  width: min(1060px, 100% - 32px); margin: 18px auto 28px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: start;
}
.ck-single { grid-template-columns: minmax(0, 520px); justify-content: center; }
.ck-card {
  position: relative;
  padding: 26px;
  border-radius: 24px;
  background: linear-gradient(170deg, rgba(36, 22, 14, .92), rgba(18, 11, 8, .94));
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);
  backdrop-filter: blur(14px);
  animation: ckIn .5s cubic-bezier(.2, .8, .2, 1) both;
}
.ck-pay { animation-delay: .06s; border-color: var(--line-2); box-shadow: 0 40px 90px -40px rgba(255, 90, 20, .45); }
@keyframes ckIn { from { opacity: 0; transform: translateY(12px); } }

/* Resumo */
.ck-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.ck-merchant { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.ck-merchant strong { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; margin-top: 2px; }
.ck-verified { color: var(--o1); flex: none; }
.ck-avatar { width: 50px; height: 50px; flex: none; border-radius: 15px; display: grid; place-items: center; font-family: var(--display); font-size: 21px; font-weight: 800; color: #1a0b02; background: var(--grad); box-shadow: 0 10px 22px -10px rgba(255, 106, 26, .9); }
.ck-amount { padding: 22px 0 18px; }
.ck-amount strong { display: block; margin-top: 4px; font-family: var(--display); font-size: clamp(36px, 6vw, 48px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.ck-amount p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.ck-rows { margin: 0; padding: 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ck-rows div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; font-size: 14px; }
.ck-rows div + div { border-top: 1px dashed rgba(255, 170, 110, .08); }
.ck-rows dt { color: var(--muted); }
.ck-rows dd { margin: 0; font-weight: 600; }
.ck-pix { display: inline-flex; align-items: center; gap: 6px; color: #5ee6c4; }
.ck-countdown { font-family: var(--mono); font-weight: 500; color: var(--o1); font-variant-numeric: tabular-nums; }
.ck-steps { list-style: none; counter-reset: s; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.ck-steps li { counter-increment: s; position: relative; padding-left: 40px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.ck-steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 27px; height: 27px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--o1); background: rgba(255, 122, 26, .12); border: 1px solid var(--line-2); }
.ck-steps b { color: var(--text); font-weight: 600; }
body.is-final .ck-only-pending { display: none; }
.ck-steps-m { display: none; }
.ck-status-time { font-family: var(--mono); font-weight: 500; color: var(--o1); padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }

/* Pagamento */
.ck-panel { display: grid; gap: 16px; }
.ck-status { display: inline-flex; align-items: center; justify-self: start; gap: 10px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: #ffd3b0; background: rgba(255, 122, 26, .1); border: 1px solid var(--line-2); }
.ck-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--o2); }
.ck-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--o2); animation: ckPulse 1.6s ease-out infinite; }
@keyframes ckPulse { to { transform: scale(3); opacity: 0; } }
.ck-timebar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; margin-top: -4px; }
.ck-timebar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--grad); transition: width 1s linear; }
.ck-timebar i.is-low { background: linear-gradient(90deg, #f87171, #fb923c); }

.ck-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 14px 20px;
  border: 0; border-radius: 16px; cursor: pointer;
  font: 700 17px var(--font); color: #1a0b02; text-decoration: none;
  background: var(--grad);
  box-shadow: 0 16px 34px -12px rgba(255, 106, 26, .85), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .15s, box-shadow .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.ck-btn:hover { transform: translateY(-1px); }
.ck-btn:active { transform: translateY(1px) scale(.99); }
.ck-btn:focus-visible { outline: 3px solid rgba(255, 179, 71, .6); outline-offset: 3px; }
.ck-copy.is-done { background: linear-gradient(135deg, #4ade80, #22c55e); box-shadow: 0 16px 34px -12px rgba(34, 197, 94, .7); }
.ck-code { padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .3); border: 1px dashed var(--line-2); max-height: 74px; overflow: hidden; position: relative; }
.ck-code::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: linear-gradient(transparent, rgba(16, 9, 6, .95)); pointer-events: none; }
.ck-code code { display: block; font-family: var(--mono); font-size: 12px; line-height: 1.5; color: #ffe2bd; word-break: break-all; user-select: all; cursor: text; }

.ck-qr-toggle { justify-self: center; display: none; border: 0; background: none; color: var(--o1); font: 600 14px var(--font); padding: 6px 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ck-qr-wrap { display: none; justify-items: center; gap: 10px; }
.ck-qr-wrap.is-open { display: grid; animation: ckIn .35s cubic-bezier(.2, .8, .2, 1); }
.ck-qr { position: relative; padding: 16px; border-radius: 22px; background: #fff; box-shadow: 0 0 0 6px rgba(255, 122, 26, .14), 0 30px 60px -24px rgba(0, 0, 0, .8); }
.ck-qr #ckQr { width: 232px; height: 232px; }
.ck-qr #ckQr img, .ck-qr #ckQr canvas { display: block; width: 232px !important; height: 232px !important; }
.ck-qr-logo { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%); padding: 4px; border-radius: 12px; background: #fff; }
.ck-qr-hint { margin: 0; font-size: 13px; color: var(--muted); }
.ck-note { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 0; padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.45; color: var(--muted); background: rgba(255, 255, 255, .025); border: 1px solid var(--line); }
.ck-note svg { flex: none; margin-top: 2px; color: var(--o1); }
.ck-note b { color: var(--text); }

/* Estados finais */
.ck-state { text-align: center; justify-items: center; padding: 18px 4px; }
.ck-state h1 { margin: 4px 0 0; font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.ck-state p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 40ch; }
.ck-state p b { color: var(--text); }
.ck-state .ck-btn { max-width: 360px; margin-top: 8px; }
.ck-small { font-size: 13px !important; color: var(--faint) !important; }
.ck-state-ico { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--o1); background: rgba(255, 122, 26, .12); border: 1px solid var(--line-2); }
.ck-state-ico.bad { color: var(--bad); background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .3); }
.ck-state-ico.warn { color: #ffc14a; }
.ck-check { width: 96px; height: 96px; filter: drop-shadow(0 0 30px rgba(74, 222, 128, .45)); }
.ck-check svg { width: 100%; height: 100%; }
.ck-check circle { fill: rgba(74, 222, 128, .12); stroke: var(--ok); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: ckDraw .6s ease-out forwards; }
.ck-check path { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: ckDraw .4s .45s ease-out forwards; }
@keyframes ckDraw { to { stroke-dashoffset: 0; } }

/* Rodapé e aviso */
.ck-foot { position: relative; z-index: 1; padding: 0 16px 26px; text-align: center; font-size: 12.5px; color: var(--faint); }
.ck-foot span { display: inline; line-height: 1.6; }
.ck-foot svg { vertical-align: -2px; margin-right: 4px; }
.ck-foot b { color: var(--muted); }
.ck-toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 20;
  transform: translate(-50%, 20px); opacity: 0;
  padding: 13px 20px; border-radius: 14px;
  font-size: 14px; font-weight: 600; color: #dcfce7;
  background: rgba(16, 40, 26, .96); border: 1px solid rgba(74, 222, 128, .35);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .8);
  transition: transform .25s, opacity .25s;
  white-space: nowrap;
}
.ck-toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* Página do link (/l) */
.ck-form { display: grid; gap: 14px; }
.ck-field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: #e4d3c6; }
.ck-field input {
  width: 100%; min-height: 52px; padding: 13px 15px;
  font: 500 16px var(--font); color: var(--text);
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 190, 140, .18); border-radius: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.ck-field input:focus { border-color: var(--o2); box-shadow: 0 0 0 4px rgba(255, 122, 26, .15); }
.ck-field input.ck-money { font-family: var(--display); font-size: 24px; font-weight: 800; }
.ck-field small { display: block; margin-top: 6px; font-size: 12px; color: var(--faint); }
.ck-error { padding: 12px 14px; border-radius: 14px; font-size: 14px; color: #fecaca; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .3); }
.ck-privacy { margin: 0; font-size: 12.5px; color: var(--faint); text-align: center; line-height: 1.5; }

/* ---------- Celular ---------- */
@media (max-width: 860px) {
  .ck-main { grid-template-columns: 1fr; gap: 14px; margin-top: 12px; }
  .ck-card { padding: 20px; border-radius: 22px; }
  /* No celular, o pagamento vem logo depois do valor */
  .ck-summary { display: grid; }
  .ck-merchant { padding-bottom: 14px; }
  .ck-amount { padding: 14px 0 6px; }
  .ck-amount strong { font-size: 38px; }
  .ck-rows, .ck-summary .ck-steps { display: none; }
  .ck-steps-m { display: grid; margin: 4px 0 0; }
  .ck-qr-toggle { display: block; }
  .ck-top { padding-top: 14px; }
}
@media (max-width: 380px) {
  .ck-secure { font-size: 0; padding: 7px; }
  .ck-secure svg { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ck-check circle, .ck-check path { stroke-dashoffset: 0; }
}
