/* ── L'abonnement en ligne (page /tarifs, abonnement.js) ─────────────────────────────────────
   La fenêtre « Votre abonnement Neurobase » : formule et options cochées, adresse, CGV, total, puis
   la page de paiement de Stripe. Rien ne s'affiche tant que l'admin n'a rien mis en vente. */

.option [data-checkout-start] { grid-column: 2; justify-self: start; margin-top: 6px; }

.ck {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-l);
  background: var(--paper);
  color: var(--ink-2);
  box-shadow: var(--shadow-l);
  overflow: auto;
}
.ck::backdrop { background: rgba(12, 16, 64, 0.42); backdrop-filter: blur(3px); }
.ck[open] { animation: ck-in 0.28s var(--ease); }
@keyframes ck-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

.ck__panel { display: grid; gap: 20px; padding: 28px; }
.ck__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ck__head .h3 { margin: 0; color: var(--ink); }
.ck__close {
  flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink-3); cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.ck__close:hover { border-color: var(--line-2); color: var(--ink); }
.ck__close .i { width: 18px; height: 18px; }

.ck__test {
  display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px;
  border-radius: var(--radius); background: var(--butter-soft); color: var(--butter-ink); font-size: 0.92rem; line-height: 1.5;
}
.ck__test .i { flex: none; width: 18px; height: 18px; margin-top: 2px; }

.ck__billing { display: flex; }
.ck__label { display: block; margin-bottom: 8px; font-size: 0.875rem; font-weight: 650; color: var(--ink); }

.ck__items { margin: 0; padding: 0; border: 0; min-width: 0; }
.ck__list { display: grid; gap: 10px; }
.ck-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  cursor: pointer; transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.ck-item:hover { border-color: var(--line-2); }
.ck-item:has(input:checked) { border-color: rgba(90, 81, 240, 0.55); background: var(--violet-soft); box-shadow: 0 0 0 1px rgba(90, 81, 240, 0.25) inset; }
.ck-item:has(input:focus-visible) { outline: 3px solid rgba(108, 99, 255, 0.55); outline-offset: 2px; }
.ck-item:has(input:disabled) { cursor: not-allowed; opacity: 0.55; }
.ck-item input { width: 20px; height: 20px; margin: 0; accent-color: var(--violet-600); grid-row: span 2; }
.ck-item__name { font-weight: 650; color: var(--ink); line-height: 1.35; }
.ck-item__note { grid-column: 2; font-size: 0.86rem; color: var(--ink-3); line-height: 1.45; }
.ck-item__price { grid-row: span 2; font-family: var(--font-mono); font-size: 0.92rem; color: var(--ink); white-space: nowrap; text-align: right; }

.ck__field { display: grid; gap: 6px; }
.ck__field .ck__label { margin: 0; }
.ck__field input {
  width: 100%; min-height: 50px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 14px;
  font: inherit; color: var(--ink); background: var(--paper);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.ck__field input:focus { outline: none; border-color: var(--violet-600); box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.16); }
.ck__field input[aria-invalid="true"] { border-color: var(--coral-ink); }
.ck__field em { font-style: normal; font-size: 0.86rem; color: var(--ink-3); }

.ck__terms { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; line-height: 1.5; cursor: pointer; }
.ck__terms input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--violet-600); }

.ck__error { margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--coral-soft); color: var(--coral-ink); font-size: 0.95rem; line-height: 1.5; }
.ck__error a { color: inherit; font-weight: 650; }

.ck__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }
.ck__total { display: grid; gap: 2px; }
.ck__total span { font-size: 0.86rem; color: var(--ink-3); }
.ck__total strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ck__foot .btn .i { width: 18px; height: 18px; }
.ck__foot .btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }

.ck__fine { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 0.84rem; color: var(--ink-3); line-height: 1.5; }
.ck__fine .i { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--mint-ink); }

.ck-flash {
  position: fixed; left: 50%; bottom: 20px; z-index: 60; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 12px 18px;
  border-radius: var(--pill); background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
  border: 1px solid var(--line); font-size: 0.95rem;
}

@media (max-width: 599px) {
  .ck { width: 100vw; max-width: 100vw; max-height: 100dvh; margin: auto 0 0; border-radius: var(--radius-l) var(--radius-l) 0 0; }
  .ck__panel { padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); gap: 18px; }
  .ck-item { grid-template-columns: auto 1fr; }
  .ck-item__price { grid-row: auto; grid-column: 2; text-align: left; }
  .ck__foot .btn { width: 100%; }
  .ck-flash { border-radius: var(--radius); }
}

@media (prefers-reduced-motion: reduce) {
  .ck[open] { animation: none; }
  .ck-item, .ck__field input, .ck__close { transition: none; }
}
