/* ZlefPay — layered on top of da.zlef.fr/tokens.css. Tokens only, no new hues. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--zl-bg); color: var(--zl-text);
  font-family: var(--zl-font); font-size: var(--zl-text-base); line-height: var(--zl-leading);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--zl-accent-soft); text-decoration: none; }
a:hover { color: var(--zl-olive-bright); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--zl-space-5); }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--zl-space-5); }
.hidden { display: none !important; }
.mono { font-family: var(--zl-font-mono); }
.center { text-align: center; }
.muted { color: var(--zl-text-muted); }
.soft { color: var(--zl-text-soft); }

/* ── header ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6,6,10,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--zl-line);
}
.nav-inner { display: flex; align-items: center; gap: var(--zl-space-5); height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: var(--zl-weight-bold); font-size: var(--zl-text-lg); color: var(--zl-text); letter-spacing: var(--zl-tracking-tight); }
.brand svg { display: block; }
.brand b { color: var(--zl-accent-soft); }
.nav-links { display: flex; align-items: center; gap: var(--zl-space-4); margin-left: auto; }
.nav-links a { color: var(--zl-text-soft); font-size: var(--zl-text-sm); }
.nav-links a:hover { color: var(--zl-text); }
.badge-env { font-size: var(--zl-text-xs); padding: 2px 8px; border-radius: var(--zl-radius-sm); border: 1px solid var(--zl-line-strong); color: var(--zl-text-muted); letter-spacing: var(--zl-tracking-wide); text-transform: uppercase; }
.badge-env.sandbox { color: var(--zl-warning); border-color: rgba(199,154,62,.4); background: var(--zl-warning-wash); }

/* ── buttons (extend zl-btn) ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-size: var(--zl-text-base); font-weight: var(--zl-weight-medium);
  padding: 11px 18px; min-height: 44px; border-radius: var(--zl-radius-md); border: 1px solid var(--zl-line-strong);
  background: var(--zl-surface-2); color: var(--zl-text); transition: background .16s cubic-bezier(.22,.61,.36,1), border-color .16s; }
.btn:hover { background: var(--zl-surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--zl-accent); border-color: var(--zl-accent-mid); color: var(--zl-on-accent); font-weight: var(--zl-weight-bold); }
.btn--primary:hover { background: var(--zl-accent-mid); }
.btn--ghost { background: transparent; }
.btn--lg { font-size: var(--zl-text-lg); padding: 14px 26px; min-height: 52px; }
.btn--sm { font-size: var(--zl-text-sm); padding: 7px 12px; min-height: 36px; }
.btn--block { width: 100%; }
.btn--danger { background: transparent; border-color: rgba(194,86,106,.4); color: var(--zl-danger); }
.btn--danger:hover { background: var(--zl-danger-wash); }

/* ── hero ── */
.hero { padding: clamp(56px, 9vw, 110px) 0 var(--zl-space-7); position: relative; }
.eyebrow { text-transform: uppercase; letter-spacing: var(--zl-tracking-wide); font-size: var(--zl-text-xs); color: var(--zl-accent-soft); font-weight: var(--zl-weight-medium); }
.hero h1 { font-size: var(--zl-text-4xl); line-height: var(--zl-leading-tight); letter-spacing: var(--zl-tracking-tight); margin: var(--zl-space-4) 0; font-weight: var(--zl-weight-bold); max-width: 16ch; }
.hero h1 em { font-style: normal; color: var(--zl-accent-soft); }
.hero p.lead { font-size: var(--zl-text-xl); color: var(--zl-text-soft); max-width: 56ch; margin: 0 0 var(--zl-space-6); }
.hero-cta { display: flex; gap: var(--zl-space-3); flex-wrap: wrap; }
.hero-trust { margin-top: var(--zl-space-6); display: flex; gap: var(--zl-space-5); flex-wrap: wrap; color: var(--zl-text-muted); font-size: var(--zl-text-sm); }
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--zl-accent-soft); display: inline-block; }

/* ── cards / grid ── */
.card { background: var(--zl-surface-1); border: 1px solid var(--zl-line); border-radius: var(--zl-radius-lg); padding: var(--zl-space-5); }
.card--accent { border-color: var(--zl-accent-mid); box-shadow: var(--zl-shadow-md); }
.grid { display: grid; gap: var(--zl-space-4); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.feature h3 { margin: var(--zl-space-2) 0 6px; font-size: var(--zl-text-lg); }
.feature p { margin: 0; color: var(--zl-text-soft); font-size: var(--zl-text-sm); }
.feature .ico { width: 38px; height: 38px; border-radius: var(--zl-radius-md); background: var(--zl-accent-wash); border: 1px solid var(--zl-accent-mid); display: grid; place-items: center; color: var(--zl-accent-soft); }
.section { padding: var(--zl-space-8) 0; }
.section h2 { font-size: var(--zl-text-3xl); letter-spacing: var(--zl-tracking-tight); margin: 0 0 var(--zl-space-2); }
.section .sub { color: var(--zl-text-soft); font-size: var(--zl-text-lg); margin: 0 0 var(--zl-space-6); }

/* ── code block ── */
.code { background: #0a0a0f; border: 1px solid var(--zl-line); border-radius: var(--zl-radius-lg); overflow: hidden; }
.code-head { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--zl-line); background: var(--zl-surface-1); flex-wrap: wrap; }
.code-tab { font-size: var(--zl-text-sm); padding: 5px 12px; border-radius: var(--zl-radius-sm); cursor: pointer; color: var(--zl-text-muted); border: 1px solid transparent; }
.code-tab.active { color: var(--zl-text); background: var(--zl-surface-2); border-color: var(--zl-line); }
.code pre { margin: 0; padding: var(--zl-space-5); overflow-x: auto; font-family: var(--zl-font-mono); font-size: var(--zl-text-sm); line-height: 1.7; color: #d6d8cc; }
.code pre .k { color: var(--zl-accent-soft); }
.code pre .s { color: var(--zl-grape-soft); }
.code pre .c { color: var(--zl-text-faint); }

/* ── forms ── */
.field { margin-bottom: var(--zl-space-4); }
.label { display: block; font-size: var(--zl-text-sm); color: var(--zl-text-soft); margin-bottom: 6px; font-weight: var(--zl-weight-medium); }
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: var(--zl-text-base); color: var(--zl-text);
  background: var(--zl-surface-2); border: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-md);
  padding: 11px 13px; min-height: 44px; transition: border-color .16s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--zl-line-focus); }
.input::placeholder { color: var(--zl-text-faint); }
.input--error { border-color: var(--zl-danger); }
.err { color: var(--zl-danger); font-size: var(--zl-text-sm); margin-top: 5px; }

/* ── dashboard ── */
.dash-head { display: flex; align-items: center; gap: var(--zl-space-5); margin-bottom: var(--zl-space-5); flex-wrap: wrap; }
.dash-titlewrap { min-width: 0; }
.dash-h1 { margin: 0; font-size: var(--zl-text-2xl); }

/* account switcher */
.acct-switch { position: relative; }
.acct-trigger { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 8px 12px; cursor: pointer; text-align: left; color: var(--zl-text); background: var(--zl-surface-1); border: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-md); transition: border-color .16s, background .16s; }
.acct-trigger:hover { background: var(--zl-surface-2); }
.acct-switch.open .acct-trigger { border-color: var(--zl-accent-soft); background: var(--zl-accent-wash); }
.acct-ava { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: var(--zl-weight-bold); background: var(--zl-accent-wash); color: var(--zl-accent-soft); border: 1px solid var(--zl-line); }
.acct-ava.plus { background: var(--zl-surface-3); color: var(--zl-text-soft); font-size: var(--zl-text-lg); }
.acct-cur { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.acct-nm { font-weight: var(--zl-weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-kind { font-size: var(--zl-text-xs); }
.acct-switch .dd-chev { flex: none; color: var(--zl-text-muted); transition: transform .2s; }
.acct-switch.open .dd-chev { transform: rotate(180deg); }
.acct-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: 320px; max-width: 86vw; padding: 6px; background: var(--zl-surface-1); border: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-md); box-shadow: var(--zl-shadow-lg, 0 16px 40px rgba(0,0,0,.5)); max-height: 70vh; overflow-y: auto; animation: ddIn .16s ease; }
.acct-grp { padding: 8px 10px 4px; font-size: var(--zl-text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--zl-text-muted); }
.acct-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--zl-radius-sm, 8px); cursor: pointer; transition: background .12s; }
.acct-opt:hover { background: var(--zl-surface-2); }
.acct-opt.sel { background: var(--zl-accent-wash); }
.acct-opt .acct-bal { margin-left: auto; font-size: var(--zl-text-xs); color: var(--zl-text-muted); white-space: nowrap; }
.acct-opt .opt-ck { flex: none; color: var(--zl-accent-soft); margin-left: 6px; }
.acct-opt.acct-new { color: var(--zl-accent-soft); font-weight: var(--zl-weight-medium); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--zl-line); margin-bottom: var(--zl-space-6); overflow-x: auto; }
.tab { padding: 12px 16px; cursor: pointer; color: var(--zl-text-muted); font-size: var(--zl-text-base); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--zl-text); }
.tab.active { color: var(--zl-text); border-bottom-color: var(--zl-accent-soft); }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--zl-space-4); margin-bottom: var(--zl-space-6); }
@media (max-width: 860px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--zl-surface-1); border: 1px solid var(--zl-line); border-radius: var(--zl-radius-lg); padding: var(--zl-space-4); }
.kpi .v { font-size: var(--zl-text-2xl); font-weight: var(--zl-weight-bold); }
.kpi .l { color: var(--zl-text-muted); font-size: var(--zl-text-sm); }
table { width: 100%; border-collapse: collapse; font-size: var(--zl-text-sm); }
th { text-align: left; color: var(--zl-text-muted); font-weight: var(--zl-weight-medium); padding: 10px 12px; border-bottom: 1px solid var(--zl-line); font-size: var(--zl-text-xs); text-transform: uppercase; letter-spacing: .06em; }
td { padding: 12px; border-bottom: 1px solid var(--zl-line); }
tr:hover td { background: var(--zl-surface-1); }
.pill { display: inline-block; font-size: var(--zl-text-xs); padding: 3px 9px; border-radius: var(--zl-radius-sm); border: 1px solid var(--zl-line-strong); }
.pill.paid { color: var(--zl-success); border-color: rgba(111,154,58,.4); background: var(--zl-success-wash); }
.pill.pending, .pill.processing { color: var(--zl-warning); border-color: rgba(199,154,62,.4); background: var(--zl-warning-wash); }
.pill.canceled, .pill.expired { color: var(--zl-text-muted); }
.pill.active { color: var(--zl-success); border-color: rgba(111,154,58,.4); }
.pill.past_due { color: var(--zl-danger); }

/* ── key reveal box ── */
.keybox { display: flex; align-items: center; gap: 8px; background: var(--zl-surface-2); border: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-md); padding: 9px 12px; font-family: var(--zl-font-mono); font-size: var(--zl-text-sm); }
.keybox code { flex: 1; overflow-x: auto; white-space: nowrap; }

/* ── checkout ── */
.checkout { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 880px) { .checkout { grid-template-columns: 1fr; } }
.co-summary { background: var(--zl-surface-1); border-right: 1px solid var(--zl-line); padding: clamp(28px,5vw,56px); display: flex; flex-direction: column; }
@media (max-width: 880px) { .co-summary { border-right: none; border-bottom: 1px solid var(--zl-line); } }
.co-pane { padding: clamp(28px,5vw,56px); display: flex; flex-direction: column; }
.co-merchant { display: flex; align-items: center; gap: 12px; margin-bottom: var(--zl-space-6); }
.co-merchant .ava { width: 44px; height: 44px; border-radius: var(--zl-radius-md); background: var(--zl-accent); color: var(--zl-on-accent); display: grid; place-items: center; font-weight: var(--zl-weight-bold); font-size: var(--zl-text-lg); }
.co-amount { font-size: clamp(38px,6vw,56px); font-weight: var(--zl-weight-bold); letter-spacing: var(--zl-tracking-tight); margin: var(--zl-space-2) 0; }
.co-amount small { font-size: var(--zl-text-lg); color: var(--zl-text-muted); font-weight: var(--zl-weight-normal); }
.co-desc { color: var(--zl-text-soft); font-size: var(--zl-text-lg); }
.co-lines { margin-top: var(--zl-space-6); border-top: 1px solid var(--zl-line); padding-top: var(--zl-space-4); }
.co-line { display: flex; justify-content: space-between; padding: 7px 0; color: var(--zl-text-soft); font-size: var(--zl-text-sm); }
/* crypto coin picker (custom icon dropdown + pay button) */
.crypto-pick { display: flex; flex-direction: column; gap: var(--zl-space-3); }
.coin-ico { flex: none; width: 28px; height: 28px; border-radius: 50%; }
.coin-ico--fb { display: grid; place-items: center; background: var(--zl-surface-3); border: 1px solid var(--zl-line); color: var(--zl-accent-soft); font-weight: var(--zl-weight-bold); font-size: var(--zl-text-xs); }
.coin-dd { position: relative; }
.coin-dd-trigger {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; cursor: pointer; text-align: left;
  color: var(--zl-text); background: var(--zl-surface-2);
  border: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-md);
  transition: border-color .16s, background .16s;
}
.coin-dd-trigger:hover { background: var(--zl-surface-3); }
.coin-dd.open .coin-dd-trigger { border-color: var(--zl-accent-soft); background: var(--zl-accent-wash); }
.coin-dd-cur { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.coin-dd-cur .nm { font-weight: var(--zl-weight-medium); font-size: var(--zl-text-md); }
.coin-dd-cur .amt { margin-left: auto; font-family: var(--zl-font-mono); font-size: var(--zl-text-sm); color: var(--zl-text-muted); white-space: nowrap; }
.dd-chev { flex: none; color: var(--zl-text-muted); transition: transform .2s; }
.coin-dd.open .dd-chev { transform: rotate(180deg); }

.coin-dd-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  padding: 6px; background: var(--zl-surface-2);
  border: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-md);
  box-shadow: var(--zl-shadow-lg, 0 16px 40px rgba(0,0,0,.5));
  max-height: 320px; overflow-y: auto;
  animation: ddIn .16s ease;
}
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.coin-opt {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--zl-radius-sm, 8px); cursor: pointer;
  transition: background .12s;
}
.coin-opt:hover, .coin-opt:focus { background: var(--zl-surface-3); outline: none; }
.coin-opt.sel { background: var(--zl-accent-wash); }
.coin-opt .nm { font-weight: var(--zl-weight-medium); font-size: var(--zl-text-md); }
.coin-opt .amt { margin-left: auto; font-family: var(--zl-font-mono); font-size: var(--zl-text-sm); color: var(--zl-text-muted); white-space: nowrap; }
.coin-opt .opt-ck { flex: none; width: 16px; color: var(--zl-accent-soft); opacity: 0; transition: opacity .12s; }
.coin-opt.sel .opt-ck { opacity: 1; }
.qr-wrap { text-align: center; }
.qr-wrap img { width: 240px; height: 240px; border-radius: var(--zl-radius-lg); border: 1px solid var(--zl-line); background: #fff; padding: 10px; }
.pay-addr { display: flex; gap: 8px; align-items: center; background: var(--zl-surface-2); border: 1px solid var(--zl-line-strong); border-radius: var(--zl-radius-md); padding: 10px 12px; margin-top: var(--zl-space-4); }
.pay-addr code { flex: 1; font-family: var(--zl-font-mono); font-size: var(--zl-text-sm); overflow-x: auto; white-space: nowrap; }
.countdown { font-family: var(--zl-font-mono); color: var(--zl-warning); }
.status-line { display: flex; align-items: center; gap: 10px; margin-top: var(--zl-space-5); color: var(--zl-text-soft); }

/* card (stripe) */
.co-or { display: flex; align-items: center; gap: 12px; margin: var(--zl-space-4) 0; color: var(--zl-text-muted); font-size: var(--zl-text-xs); text-transform: uppercase; letter-spacing: .06em; }
.co-or::before, .co-or::after { content: ''; flex: 1; height: 1px; background: var(--zl-line); }
#payCard { display: flex; align-items: center; justify-content: center; gap: 0; }
.card-ico { opacity: .9; }
#payElement { margin-top: var(--zl-space-4); transition: opacity .2s; }
.card-err { background: var(--zl-danger-wash, rgba(217,112,122,.12)); border: 1px solid var(--zl-danger, #d9707a); color: var(--zl-danger, #d9707a); border-radius: var(--zl-radius-md); padding: 10px 12px; font-size: var(--zl-text-sm); margin-bottom: var(--zl-space-4); }

/* spinner */
.spin { width: 18px; height: 18px; border: 2px solid var(--zl-line-strong); border-top-color: var(--zl-accent-soft); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.big-spin { width: 46px; height: 46px; border-width: 3px; margin: 0 auto; }

/* paid splash */
.paid-splash { text-align: center; padding: var(--zl-space-7) 0; }
.paid-check { width: 78px; height: 78px; border-radius: 50%; background: var(--zl-success-wash); border: 2px solid var(--zl-success); display: grid; place-items: center; margin: 0 auto var(--zl-space-5); color: var(--zl-success); animation: pop .4s cubic-bezier(.22,.61,.36,1); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--zl-surface-1), var(--zl-surface-2), var(--zl-surface-1)); background-size: 200% 100%; animation: sh 1.3s infinite; border-radius: var(--zl-radius-md); }
@keyframes sh { to { background-position: -200% 0; } }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--zl-surface-3); border: 1px solid var(--zl-line-strong); color: var(--zl-text); padding: 12px 18px; border-radius: var(--zl-radius-md); box-shadow: var(--zl-shadow-lg); opacity: 0; transition: all .25s cubic-bezier(.22,.61,.36,1); z-index: 100; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.fade-in { animation: fade .4s cubic-bezier(.22,.61,.36,1); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.footer { border-top: 1px solid var(--zl-line); padding: var(--zl-space-6) 0; color: var(--zl-text-muted); font-size: var(--zl-text-sm); margin-top: var(--zl-space-8); }
.footer a { color: var(--zl-text-soft); }
.row { display: flex; gap: var(--zl-space-3); align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: var(--zl-space-3); }
hr.sep { border: none; border-top: 1px solid var(--zl-line); margin: var(--zl-space-5) 0; }
