/* "Créer ma carte": one question per screen, then the build log beside the card being drawn. Same tokens as site.css. */
.cf { min-height: 100svh; display: flex; flex-direction: column; }
.cf-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; height: 64px; padding: 0 max(24px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--night) 80%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.cf-progress { flex: 1; max-width: 360px; margin: 0 auto; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.cf-progress span { display: block; height: 100%; width: 0; background: var(--blue-hi); border-radius: 4px; transition: width .6s var(--ease); }
.cf-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 72px 24px 96px; }
.cf-screen { max-width: 640px; margin: 0 auto; text-align: center; animation: cf-in .5s var(--ease) both; }
.cf-screen[hidden] { display: none; }
@keyframes cf-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.cf-count { margin: 0 0 12px; color: var(--blue-hi); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cf h1 { font: 500 clamp(32px, 4.6vw, 52px)/1.06 var(--display); letter-spacing: -0.03em; margin: 0 0 12px; text-wrap: balance; outline: none; }
.cf-sub { color: var(--text-2); font-size: 18px; margin: 0 auto 40px; max-width: 30em; }

/* answers */
.cf-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cf-tile { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border-radius: 16px; background: var(--ink); border: 1px solid var(--line); color: var(--text); font: 500 16px/1.25 var(--body); text-align: left; cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .12s var(--ease); }
.cf-tile:hover { border-color: var(--line-2); background: var(--ink-2); }
.cf-tile:active { transform: scale(.98); }
.cf-tile[aria-checked="true"] { border-color: var(--blue-hi); background: rgba(47, 107, 255, .12); }
.cf-swatch { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.cf-swatch i { width: 12px; height: 12px; border-radius: 50%; }
.cf-tiles--n { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cf-tiles--n .cf-tile { flex-direction: column; justify-content: center; gap: 2px; text-align: center; min-height: 104px; }
.cf-tiles--n b { font: 500 32px/1 var(--display); }
.cf-tiles--n span { color: var(--text-2); font-size: 14px; font-weight: 400; }

.cf-form { display: flex; flex-direction: column; gap: 16px; max-width: 480px; margin: 0 auto; text-align: left; }
.cf-input { display: block; width: 100%; height: 56px; padding: 0 18px; margin-top: 8px; border-radius: 14px; background: var(--ink); border: 1px solid var(--line-2); color: var(--text); font: 400 18px/1 var(--body); }
.cf-input:focus { outline: none; border-color: var(--blue-hi); box-shadow: 0 0 0 4px rgba(127, 163, 255, .18); }
.cf-input::placeholder { color: var(--muted); }
.cf-label { display: block; color: var(--text-2); font-size: 15px; }
.cf-stamps { border: 0; padding: 0; margin: 0; }
.cf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.cf-chip span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); cursor: pointer; font-size: 15px; transition: all .15s var(--ease); }
.cf-chip input:checked + span { border-color: var(--blue-hi); background: rgba(47, 107, 255, .14); color: var(--text); }
.cf-chip input:focus-visible + span { outline: 2px solid var(--blue-hi); outline-offset: 2px; }
.cf .btn-primary.big { height: 56px; border-radius: 999px; font-size: 17px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 24px rgba(40, 98, 240, .28); }
.cf-next { margin-top: 8px; }
.cf-back { margin-top: 32px; background: none; border: 0; color: var(--text-2); font: 400 15px var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cf-back:hover { color: var(--text); }

/* the build */
.cf-build, .cf-result { max-width: none; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 64px; align-items: start; text-align: left; }
.cf-build h1 { font-size: clamp(30px, 3.6vw, 44px); }
.cf-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 20px 0 32px; }
.cf-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue-btn), var(--blue-hi)); border-radius: 6px; transition: width .5s var(--ease); }
.cf-log { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 20px; }
.cf-step { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 14px; animation: cf-in .4s var(--ease) both; }
.cf-step b { display: block; font-weight: 500; font-size: 17px; margin-bottom: 4px; }
.cf-step ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.cf-step ul li { color: var(--text-2); font-size: 15px; animation: cf-line .35s var(--ease) both; }
.cf-step.is-done ul li { color: var(--muted); }
@keyframes cf-line { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.cf-spin { width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--blue-hi); animation: cf-spin .8s linear infinite; }
.is-done .cf-spin { animation: none; border: 0; background: var(--blue-btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 70% no-repeat; }
@keyframes cf-spin { to { transform: rotate(360deg); } }
.cf-build__card { position: sticky; top: 112px; }
.cf-stage { display: grid; place-items: center; min-height: 440px; border-radius: 28px; background: radial-gradient(circle at 50% 40%, rgba(47, 107, 255, .16), transparent 60%), var(--ink); border: 1px solid var(--line); padding: 40px 24px; }
.cf-pass { width: 100%; max-width: 320px; box-shadow: 0 32px 64px rgba(0, 0, 0, .45); transition: background-color .8s var(--ease), color .8s var(--ease); }
.cf-skel { display: inline-block; width: 120px; height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--p-fg) 18%, transparent); animation: cf-pulse 1.2s ease-in-out infinite; vertical-align: middle; }
.cf-skel--strip { display: block; width: 100%; height: 88px; border-radius: 12px; grid-column: 1 / -1; }
@keyframes cf-pulse { 50% { opacity: .45; } }
.cf-wallet { padding-bottom: 14px; border-radius: 16px; overflow: hidden; }
.cf-wallet .cf-band { margin: 0 -12px; }
.cf-wallet .cf-band img { display: block; width: 100%; height: auto; }
.cf-wallet .cf-band .cf-skel--strip { display: block; height: 96px; margin: 0 12px; border-radius: 8px; }
.cf-mono { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font: 700 15px/1 "Geist", sans-serif; transition: background-color .8s; }

/* the result */
.cf-result__card { display: flex; flex-direction: column; gap: 24px; }
.cf-made { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; font-size: 15px; color: var(--text-2); }
.cf-made li, .cf-ready { display: flex; align-items: center; gap: 10px; }
.cf-made .tick, .cf-ready .tick { background: rgba(127, 163, 255, .16); color: var(--blue-hi); }
.cf-ready { margin: 0 0 12px; color: var(--blue-hi); font-weight: 500; }
.cf-result h1 { font-size: clamp(30px, 3.8vw, 46px); margin-bottom: 24px; }
.cf-offer { border-radius: 24px; border: 1px solid rgba(127, 163, 255, .3); background: linear-gradient(180deg, rgba(47, 107, 255, .14), var(--ink) 70%); overflow: hidden; margin-bottom: 24px; }
.cf-free { margin: 0; padding: 24px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); }
.cf-free b { font: 500 clamp(30px, 3.4vw, 40px)/1.05 var(--display); letter-spacing: -0.025em; }
.cf-free span { color: var(--text-2); }
.cf-plan { padding: 20px 24px 24px; }
.cf-plan p { margin: 0; }
.cf-plan__label { color: var(--muted); font-size: 14px; }
.cf-plan__name { font: 500 24px/1.2 var(--display); margin: 2px 0 6px !important; }
.cf-plan__why { color: var(--text-2); font-size: 15.5px; margin-bottom: 12px !important; }
.cf-plan__price { font-size: 15px; color: var(--text-2); }
.cf-plan__price b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.cf-plan__price a { color: var(--blue-hi); }
.cf-account { display: flex; flex-direction: column; gap: 16px; }
.cf-check { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 14.5px; }
.cf-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--blue-btn); }
.cf-check a { color: var(--text); }
.cf-go { width: 100%; }
.cf-fine { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 860px) {
  .cf-main { padding: 40px 20px 72px; }
  .cf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cf-tiles--n { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cf-build, .cf-result { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .cf-build__card { order: -1; position: sticky; top: 64px; z-index: 2; margin: 0 -20px; padding: 12px 20px; background: linear-gradient(var(--night) 85%, transparent); }
  .cf-build .cf-stage { min-height: 0; padding: 16px; border-radius: 20px; }
  .cf-build .cf-pass { max-width: 260px; }
  .cf-build .cf-pass .pass-qr { display: none; }
  .cf-build .cf-skel--strip { height: 64px; }
  .cf-sub { font-size: 17px; margin-bottom: 32px; }
  .cf-top { gap: 16px; padding: 0 16px; }
  .cf-made { display: none; }
  .cf-result .cf-stage { padding: 20px; }
  .cf-result .cf-pass { max-width: 280px; }
  .cf-go { font-size: 16px !important; padding: 0 16px !important; white-space: normal; line-height: 1.2; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-screen, .cf-step, .cf-step ul li { animation: none; }
  .cf-spin { animation-duration: 2.4s; }
}
