/* Checkout flow v3 (ticket #371): Duolingo-style hub, story screens, plan
   picker and success screen. Own namespace (ckf-) so nothing depends on the
   Tailwind build. Dark screens sit on a deep navy gradient with a white
   cloud footer; the picker is a white sheet under a navy header. */

:root {
    /* App palette: the shell's navy (#0f172a -> #1e293b), emerald actions,
       teal/sky accents. Duolingo's blues and purples were replaced (owner
       2026-09-19: "use ours a bit more"). */
    --ckf-navy: #0f172a;
    --ckf-navy-2: #1e293b;
    --ckf-navy-warm: #134e4a;
    --ckf-green: #34d399;
    --ckf-blue: #059669;
    --ckf-blue-dark: #047857;
    --ckf-accent: #10b981;
    --ckf-grad: linear-gradient(90deg, #059669 0%, #14b8a6 55%, #0ea5e9 100%);
    --ckf-ink: #1f2937;
    --ckf-muted: #6b7280;
    --ckf-line: #e5e7eb;
    --ckf-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Hub (S0) ---------- */
.ckf-hub { font-family: var(--ckf-font); max-width: 34rem; margin: 0 auto; padding: 0.25rem 0.25rem 1rem; }
/* Inside the paywall modal the close X sits at the top-right; clear it. */
.pro-modal .ckf-hub { padding-top: 3.5rem; }
.ckf-hub-title { font-size: 2rem; font-weight: 800; color: #fff; margin: 0.5rem 0 1.25rem; }
.ckf-hub-label { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.08em; color: #8b93a7; margin: 0 0 0.9rem 0.1rem; }
/* /app/pro wrapper for the hub: no outer box on phones, the page card from tablet up. */
.ckf-hub-page { padding: 0; }
@media (min-width: 640px) {
    .ckf-hub-page { background: rgba(15, 23, 41, 0.8); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 0.75rem; padding: 1.5rem; }
}
.ckf-hub-card { position: relative; border: 2px solid rgba(255, 255, 255, 0.12); border-radius: 1.1rem; background: rgba(15, 23, 41, 0.9); margin-bottom: 1rem; overflow: hidden; }
.ckf-hub-card.is-recommended { border-color: rgba(16, 185, 129, 0.55); box-shadow: 0 0 40px -14px rgba(16, 185, 129, 0.5); }
.ckf-hub-ribbon { background: var(--ckf-grad); color: #fff; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.06em; padding: 0.55rem 1.1rem; }
.ckf-hub-body { display: flex; gap: 0.75rem; align-items: flex-start; padding: 1.1rem 1.1rem 0.5rem; }
.ckf-hub-text { flex: 1 1 0; min-width: 0; }
.ckf-hub-name { font-size: 1.45rem; font-weight: 800; color: #fff; margin-bottom: 0.7rem; }
.ckf-hub-list { list-style: none; margin: 0; padding: 0; }
.ckf-hub-list li { display: flex; gap: 0.75rem; align-items: flex-start; color: #e6e9f2; font-size: 1.02rem; line-height: 1.4; margin-bottom: 0.55rem; }
.ckf-hub-list i { color: var(--ckf-green); font-size: 0.95rem; margin-top: 0.3rem; }
.ckf-hub-art { width: 7rem; height: 7rem; flex: 0 0 auto; object-fit: contain; }
.ckf-hub-cta { display: block; width: calc(100% - 2.2rem); background: none; cursor: pointer; font-family: var(--ckf-font); font-size: 0.95rem; margin: 0.6rem 1.1rem 1.1rem; padding: 0.85rem 1rem; text-align: center; border: 2px solid rgba(255, 255, 255, 0.18); border-bottom-width: 4px; border-radius: 0.9rem; color: var(--ckf-green); font-weight: 800; letter-spacing: 0.05em; text-decoration: none; transition: background 0.15s; }
.ckf-hub-cta:hover { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
.ckf-hub-foot { text-align: center; margin: 0.5rem 0 1rem; }
.ckf-hub-dismiss { background: none; border: 0; color: #8b93a7; font-size: 0.9rem; padding: 0.5rem 1rem; cursor: pointer; }
.ckf-hub-dismiss:hover { color: #fff; }
.ckf-hub [data-feature-banner]:not(.hidden) { margin: 0 0 1rem; }

/* ---------- Full-screen flow ---------- */
.ckf { position: fixed; inset: 0; z-index: 230; font-family: var(--ckf-font); color: #fff; background: linear-gradient(180deg, var(--ckf-navy) 0%, var(--ckf-navy-2) 100%); }
.ckf-success { position: relative; inset: auto; z-index: auto; min-height: calc(100vh - 4rem); border-radius: 1rem; overflow: hidden; }
body.ckf-open { overflow: hidden; }
.ckf-step { position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; animation: ckf-in 0.3s ease-out; }
.ckf-success .ckf-step { position: relative; min-height: calc(100vh - 4rem); }
.ckf-step[hidden] { display: none; }
.ckf-step { scrollbar-width: none; }
.ckf-step::-webkit-scrollbar { display: none; }
@keyframes ckf-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ckf-dark { background: linear-gradient(180deg, var(--ckf-navy) 0%, var(--ckf-navy-2) 100%); }
.ckf-dark-warm { background: linear-gradient(180deg, var(--ckf-navy) 0%, #1e293b 55%, var(--ckf-navy-warm) 100%); }
.ckf-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem 0; }
.ckf-success .ckf-top { position: relative; padding-top: 1rem; }
.ckf-x { width: 2.75rem; height: 2.75rem; border: 0; background: none; color: #aab0c3; font-size: 1.6rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ckf-x:hover { color: #fff; }
.ckf-badge { display: inline-block; background: var(--ckf-grad); color: #fff; font-style: italic; font-weight: 900; letter-spacing: 0.06em; font-size: 0.8rem; padding: 0.35rem 0.75rem; border-radius: 0.45rem; transform: skewX(-6deg); }
.ckf-badge-inline { transform: none; font-size: 0.7rem; padding: 0.25rem 0.55rem; }
.ckf-h1 { font-size: clamp(1.6rem, 6.4vw, 2.2rem); line-height: 1.2; font-weight: 800; text-align: center; margin: 0; padding: calc(4.5rem + env(safe-area-inset-top, 0px)) 1.5rem 0; }
.ckf-h1-sm { font-size: clamp(1.5rem, 6vw, 1.9rem); padding-top: calc(4.25rem + env(safe-area-inset-top, 0px)); }
.ckf-hl { color: var(--ckf-green); }
.ckf-stage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 1.25rem 1.5rem 0; min-height: 14rem; position: relative; z-index: 1; }
.ckf-stage-sm { flex: 0 0 auto; min-height: 12rem; }
.ckf-art { width: min(68vw, 20rem); max-height: 38vh; height: auto; object-fit: contain; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.35)); }
.ckf-art-sm { width: min(48vw, 14rem); max-height: 26vh; }
.ckf-float { animation: ckf-float 3.6s ease-in-out infinite; }
@keyframes ckf-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.ckf-clouds { flex: 0 0 auto; height: 11rem; margin-top: -3.5rem; background: radial-gradient(circle at 15% 100%, #fff 0 30%, transparent 31%), radial-gradient(circle at 40% 110%, #fff 0 38%, transparent 39%), radial-gradient(circle at 68% 100%, #fff 0 34%, transparent 35%), radial-gradient(circle at 92% 108%, #fff 0 30%, transparent 31%), linear-gradient(180deg, transparent 0 55%, #fff 56%); background-repeat: no-repeat; position: relative; z-index: 0; }
.ckf-clouds::before { content: ''; position: absolute; inset: -2.5rem 0 40%; background: radial-gradient(circle at 8% 100%, rgba(255, 255, 255, 0.16) 0 34%, transparent 35%), radial-gradient(circle at 55% 110%, rgba(255, 255, 255, 0.16) 0 40%, transparent 41%), radial-gradient(circle at 88% 100%, rgba(255, 255, 255, 0.16) 0 32%, transparent 33%); background-repeat: no-repeat; z-index: -1; }
.ckf-foot { flex: 0 0 auto; margin-top: auto; background: #fff; padding: 0.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); position: sticky; bottom: 0; z-index: 2; }
.ckf-foot-light { background: #fff; }
.ckf-cta { display: block; width: 100%; border: 0; border-bottom: 4px solid var(--ckf-blue-dark); background: linear-gradient(90deg, #059669 0%, #10b981 100%); color: #fff; font-family: var(--ckf-font); font-weight: 800; letter-spacing: 0.05em; font-size: 1.05rem; padding: 1rem 1rem; border-radius: 1rem; cursor: pointer; text-align: center; text-decoration: none; transition: filter 0.15s, transform 0.05s; }
.ckf-cta:hover { filter: brightness(1.08); }
.ckf-cta:active { transform: translateY(2px); border-bottom-width: 2px; }
.ckf-cta:disabled { background: #475569; border-bottom-color: #334155; color: #cbd5e1; cursor: default; }
.ckf-options { flex: 0 0 auto; padding: 0.5rem 1.25rem; position: relative; z-index: 1; }
.ckf-option { display: flex; width: 100%; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.08); border: 2px solid rgba(255, 255, 255, 0.18); border-radius: 1rem; color: #fff; font-family: var(--ckf-font); font-size: 1.15rem; font-weight: 800; padding: 1.05rem 1.25rem; margin-bottom: 0.75rem; cursor: pointer; text-align: left; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.ckf-option:hover { background: rgba(255, 255, 255, 0.14); }
.ckf-option.is-selected { border-color: var(--ckf-green); background: rgba(52, 211, 153, 0.14); }
.ckf-option-date { font-weight: 600; font-size: 0.95rem; color: #d7d9e2; }
.ckf-options-actions .ckf-option { font-size: 1rem; padding: 0.9rem 1.1rem; }
.ckf-options-actions .ckf-option i:first-child { width: 1.4rem; color: var(--ckf-green); }
.ckf-note { text-align: center; color: #d7d9e2; font-size: 0.95rem; padding: 0.5rem 1.5rem 0.75rem; }
.ckf-success-trial, .ckf-success-wait { text-align: center; color: #d7d9e2; padding: 0 1.5rem 0.75rem; font-weight: 600; }
.ckf-legal-dark { color: #aab0c3; }
.ckf-legal-dark a { color: var(--ckf-green); }

/* ---------- Proof (S5): dark top, white table below ---------- */
.ckf-split { background: #fff; }
.ckf-split-top { background: linear-gradient(180deg, var(--ckf-navy) 0%, var(--ckf-navy-2) 100%); padding-bottom: 0; position: relative; }
.ckf-peek { height: 11rem; position: relative; overflow: visible; background: radial-gradient(circle at 20% 130%, #fff 0 36%, transparent 37%), radial-gradient(circle at 50% 140%, #fff 0 44%, transparent 45%), radial-gradient(circle at 82% 130%, #fff 0 38%, transparent 39%), linear-gradient(180deg, transparent 0 70%, #fff 71%); background-repeat: no-repeat; margin-top: 1rem; }
.ckf-art-peek { position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%); width: 10rem; filter: none; }
.ckf-h1-proof { font-size: clamp(1.3rem, 5.2vw, 1.7rem); padding-bottom: 0.5rem; }
.ckf-split-bottom { flex: 1 1 auto; padding: 0.5rem 1.25rem 1rem; color: var(--ckf-ink); }
.ckf-proof-sub { text-align: center; color: var(--ckf-muted); font-size: 0.9rem; margin: 0 0 0.75rem; }
.ckf-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 1.05rem; }
.ckf-table th { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.05em; color: var(--ckf-ink); padding: 0.5rem 0.4rem; text-align: center; }
.ckf-table td { padding: 0.8rem 0.4rem; text-align: center; color: var(--ckf-ink); }
.ckf-table td:first-child { text-align: left; }
.ckf-table th:last-child, .ckf-table td:last-child { background: #ecfdf5; }
.ckf-table thead th:last-child { border-radius: 1rem 1rem 0 0; }
.ckf-table tbody tr:last-child td:last-child { border-radius: 0 0 1rem 1rem; }
.ckf-check { color: var(--ckf-accent); font-size: 1.15rem; }
.ckf-check-dark { color: var(--ckf-ink); font-size: 1.15rem; }
.ckf-dash { display: inline-block; width: 1.1rem; height: 0.28rem; border-radius: 0.2rem; background: #d5d5d5; }

/* ---------- Plan picker (S6, S6b) ---------- */
.ckf-light { background: #fff; color: var(--ckf-ink); }
.ckf-plans-head { flex: 0 0 auto; background: linear-gradient(180deg, var(--ckf-navy) 0%, var(--ckf-navy-2) 100%); color: #fff; padding-bottom: 1.5rem; position: relative; border-radius: 0 0 1.5rem 1.5rem; }
.ckf-plans-body { flex: 1 1 auto; padding: 1.25rem 1rem 1rem; }
.ckf-plan[hidden] { display: none; }
.ckf-plan { position: relative; display: block; width: 100%; text-align: left; background: #fff; border: 2px solid var(--ckf-line); border-radius: 1.1rem; padding: 1.1rem 1.1rem 1rem; margin-bottom: 0.9rem; cursor: pointer; font-family: var(--ckf-font); color: var(--ckf-ink); transition: border-color 0.15s, box-shadow 0.15s; }
.ckf-plan::before { content: ''; position: absolute; inset: -2px; border-radius: 1.1rem; padding: 3px; background: var(--ckf-grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.ckf-plan.is-selected::before { opacity: 1; }
.ckf-plan.is-selected { border-color: transparent; }
.ckf-plan-check { position: absolute; top: -0.85rem; right: -0.6rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--ckf-accent); color: #fff; display: none; align-items: center; justify-content: center; font-size: 0.95rem; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
.ckf-plan.is-selected .ckf-plan-check { display: flex; }
.ckf-plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.ckf-plan-name { font-size: 1.5rem; font-weight: 800; }
.ckf-plan-total { font-size: 1rem; font-weight: 700; color: #4b4b4b; margin-top: 0.15rem; }
.ckf-plan-rate { font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.ckf-plan-body { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.ckf-plan-list { list-style: none; margin: 0; padding: 0; flex: 1 1 0; min-width: 0; }
.ckf-plan-list li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 1rem; line-height: 1.35; margin-bottom: 0.45rem; }
.ckf-plan-list i { color: var(--ckf-accent); margin-top: 0.25rem; font-size: 0.9rem; }
.ckf-plan-art { width: 6rem; height: 6rem; object-fit: contain; flex: 0 0 auto; }
.ckf-plan-compact { padding-top: 1.25rem; }
.ckf-plan-ribbon { position: absolute; top: -2px; left: -2px; background: var(--ckf-grad); color: #fff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; padding: 0.45rem 0.85rem; border-radius: 1.1rem 0 0.8rem 0; }
.ckf-plan-compact .ckf-plan-head { margin-top: 0.75rem; }
.ckf-plan-line { margin-top: 0.5rem; font-size: 0.98rem; color: #4b4b4b; }
.ckf-plan-note { margin-top: 0.5rem; font-size: 0.78rem; color: #9a9a9a; }
.ckf-divider { display: flex; align-items: center; gap: 0.75rem; color: #9a9a9a; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; margin: 0.9rem 0 1rem; }
.ckf-divider::before, .ckf-divider::after { content: ''; flex: 1 1 0; height: 2px; background: #ecfdf5; }
.ckf-more { text-align: center; padding: 0.75rem 0 0.25rem; }
.ckf-more-q { color: var(--ckf-muted); font-size: 0.98rem; margin-bottom: 0.6rem; }
.ckf-link { background: none; border: 0; color: var(--ckf-blue); font-family: var(--ckf-font); font-weight: 800; letter-spacing: 0.05em; font-size: 1rem; cursor: pointer; padding: 0.5rem; }
.ckf-local { text-align: center; color: #9a9a9a; font-size: 0.8rem; padding: 0.25rem 0 0.5rem; }
.ckf-foot-plans { border-top: 2px solid #f0f0f0; }
.ckf-recurring { text-align: center; color: var(--ckf-muted); font-size: 0.95rem; padding: 0.6rem 0 0.7rem; }
.ckf-legal { color: #8a8a8a; font-size: 0.72rem; line-height: 1.4; text-align: center; margin: 0.75rem 0 0; }
.ckf-legal:empty { display: none; }

@media (min-width: 640px) {
    .ckf-step { max-width: 30rem; left: 50%; right: auto; transform: translateX(-50%); width: 100%; border-radius: 1.25rem; top: 2vh; bottom: 2vh; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); overflow: hidden; overflow-y: auto; animation: ckf-in-desktop 0.3s ease-out; }
    .ckf { background: rgba(4, 8, 20, 0.85); }
    .ckf-top { max-width: 30rem; left: 50%; right: auto; transform: translateX(-50%); width: 100%; top: 2vh; }
    .ckf-success .ckf-step { max-width: none; left: auto; transform: none; top: auto; bottom: auto; box-shadow: none; border-radius: 1rem; }
    .ckf-success .ckf-top { max-width: none; left: auto; transform: none; top: auto; }
    @keyframes ckf-in-desktop { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
}

/* Phones: a notch smaller than the desktop card, closer to Duolingo's
   proportions (owner 2026-09-22, "fonts seem a little bigger on mobile"). */
@media (max-width: 639px) {
    .ckf-h1 { font-size: clamp(1.4rem, 5.6vw, 1.9rem); }
    .ckf-h1-sm { font-size: clamp(1.3rem, 5.2vw, 1.7rem); }
    .ckf-h1-proof { font-size: clamp(1.2rem, 4.8vw, 1.55rem); }
    .ckf-badge { font-size: 0.72rem; padding: 0.3rem 0.65rem; }
    .ckf-cta { font-size: 0.95rem; padding: 0.9rem 1rem; }
    .ckf-option { font-size: 1.02rem; padding: 0.95rem 1.1rem; }
    .ckf-option-date { font-size: 0.85rem; }
    .ckf-note { font-size: 0.88rem; }
    .ckf-table { font-size: 0.95rem; }
    .ckf-table th { font-size: 0.78rem; }
    .ckf-plan-name { font-size: 1.3rem; }
    .ckf-plan-total { font-size: 0.92rem; }
    .ckf-plan-rate { font-size: 0.98rem; }
    .ckf-plan-list li { font-size: 0.92rem; }
    .ckf-plan-line { font-size: 0.9rem; }
    .ckf-more-q { font-size: 0.9rem; }
    .ckf-link { font-size: 0.92rem; }
    .ckf-recurring { font-size: 0.88rem; }
    .ckf-hub-title { font-size: 1.7rem; }
    /* Phones: the label gets its own strip instead of sitting on the page background. */
    .ckf-hub-page .ckf-hub-label { background: rgba(15, 23, 41, 0.8); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 0.75rem; padding: 0.7rem 1rem; margin: 0 0 0.9rem; }
    .ckf-hub-name { font-size: 1.3rem; }
    .ckf-hub-list li { font-size: 0.95rem; }
    .ckf-hub-cta { font-size: 0.88rem; padding: 0.8rem 1rem; }
    .ckf-hub-art { width: 6rem; height: 6rem; }
}
