/**
 * SS Membership — Level Card chrome (preset-fit polish)
 *
 * v0.41.0: Rebuilt to the approved membership mock
 * (_prototypes/tspkey/mock-membership-checkout.html). A light, marketing-grade
 * tier card: eyebrow → big serif price + cadence → billing sub-line → feature
 * list → accent CTA → trial footnote, with an optional FEATURED state (accent
 * border + "Best Value" pill) and an optional "Save X%" badge.
 *
 * TOKEN-DRIVEN — NO hardcoded brand colors or fonts. Every brand-carrying value
 * resolves from the active preset's shell/preset tokens (the same vocabulary the
 * g-sections consume), so the card adopts whatever preset is painted. Literals
 * below are LAST-RESORT fallbacks for the token-less standalone case only.
 *
 * Token mapping (mock role → SS token → fallback):
 *   heading / price face   var(--shell-hf)      serif stack
 *   body face              var(--shell-bf)      system sans
 *   price color (navy)     var(--preset-primary)→ var(--shell-h)
 *   eyebrow / accent(gold) var(--shell-accent)  → var(--ss-accent)
 *   CTA fill / text        var(--ssla-button-*) → accent / readable ink
 *   card surface           var(--shell-card)    → #fff
 *   hairline / border      var(--shell-hairline)→ #d8d8d4
 *   muted sub-text         var(--shell-m)
 *   body text              var(--shell-text-body)
 *   "Save"/tick positive   var(--ssc-good)      (module semantic, overridable)
 *   corner radius          var(--ssc-radius)    (tokenized so squared presets → 0)
 */

.ssm-level-card {
    /* ---- token contract + fallbacks (theme/preset :root overrides win) ---- */
    /* brand */
    --ssc-accent:            var(--shell-accent, var(--ss-accent, #534AB7));
    --ssc-accent-hover:      var(--shell-accent-hover, var(--ssc-accent));
    --ssc-primary:           var(--preset-primary, var(--shell-h, #1d1d1b));
    --ssc-btn-fill:          var(--ssla-button-fill, var(--ssc-accent));
    --ssc-btn-fg:            var(--ssla-button-text, var(--brand-accent-fg, #ffffff));
    /* surfaces + text */
    --ssc-surface:           var(--shell-card, #ffffff);
    --ssc-surface-warm:      var(--shell-surface-warm, var(--shell-bg-warm, #f5f5f0));
    --ssc-surface-fg:        var(--shell-text-body, var(--shell-h, #1d1d1b));
    --ssc-surface-fg-muted:  var(--shell-m, #6c6c68);
    --ssc-border:            var(--shell-hairline, #d8d8d4);
    /* positive / save semantic (no shell success token today — overridable) */
    --ssc-good:              #4f8a52;
    /* geometry */
    --ssc-radius:            6px;

    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--ssc-surface);
    color: var(--ssc-surface-fg);
    border: 1px solid var(--ssc-border);
    border-radius: var(--ssc-radius);
    overflow: visible;
    font-family: var(--shell-bf, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    line-height: 1.55;
    margin: 0 0 1.5rem;
    padding: 30px 26px;
    box-sizing: border-box;
}

.ssm-level-card *,
.ssm-level-card *::before,
.ssm-level-card *::after {
    box-sizing: border-box;
}

/* ============================================================ */
/* FEATURED (Best Value) + Save badge                           */
/* ============================================================ */

.ssm-level-card--featured {
    border-color: var(--ssc-accent);
    box-shadow: 0 16px 40px rgba(15, 43, 76, 0.10);
}

.ssm-level-card__flag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ssc-accent);
    color: var(--ssc-btn-fg);
    font-family: var(--shell-bf, sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 100px;
    white-space: nowrap;
    line-height: 1.2;
}

.ssm-level-card__save {
    display: inline-block;
    background: color-mix(in srgb, var(--ssc-good) 14%, transparent);
    color: var(--ssc-good);
    font-family: var(--shell-bf, sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ============================================================ */
/* HEADER (eyebrow → price → billing sub-line)                  */
/* ============================================================ */

.ssm-level-card__header {
    padding: 0;
    background: transparent;
}

.ssm-level-card__eyebrow {
    font-family: var(--shell-bf, sans-serif);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--ssc-accent);
    margin: 0 0 4px;
}

/* Level name kept as an accessible, visually-secondary label. */
.ssm-level-card__name {
    font-family: var(--shell-hf, Georgia, serif);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    margin: 0;
    color: var(--ssc-surface-fg);
}

.ssm-level-card__price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
    margin: 12px 0 2px;
}

.ssm-level-card__price-amount {
    font-family: var(--shell-hf, Georgia, serif);
    font-size: 46px;
    font-weight: 400;
    line-height: 1;
    color: var(--ssc-primary);
    letter-spacing: 0;
}

.ssm-level-card__price-cadence {
    font-family: var(--shell-bf, sans-serif);
    font-size: 15px;
    font-weight: 400;
    color: var(--ssc-surface-fg-muted);
}

.ssm-level-card__bill {
    font-family: var(--shell-bf, sans-serif);
    font-size: 13.5px;
    color: var(--ssc-surface-fg-muted);
    margin: 0 0 18px;
}

/* ============================================================ */
/* BODY (features list)                                         */
/* ============================================================ */

.ssm-level-card__body {
    padding: 0;
    flex: 1;
    background: transparent;
    margin-bottom: 22px;
}

.ssm-level-card__features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ssm-level-card__feature {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px;
    align-items: start;
    font-size: 14px;
    color: var(--ssc-surface-fg);
    line-height: 1.45;
}

.ssm-level-card__feature-icon {
    color: var(--ssc-accent);
    flex-shrink: 0;
    margin-top: 3px;
}

.ssm-level-card__feature-text {
    flex: 1;
}

.ssm-level-card__no-features {
    font-size: 13px;
    color: var(--ssc-surface-fg-muted);
    font-style: italic;
    margin: 0;
}

/* ============================================================ */
/* FOOTER (accent CTA + trial footnote)                         */
/* ============================================================ */

.ssm-level-card__footer {
    padding: 0;
    margin-top: auto;
    background: transparent;
    border-top: 0;
}

.ssm-level-card__cta {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ssc-btn-fill);
    color: var(--ssc-btn-fg);
    border: 1px solid var(--ssc-btn-fill);
    padding: 14px 26px;
    font-family: var(--shell-bf, sans-serif);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    text-align: center;
    cursor: pointer;
    border-radius: 3px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ssm-level-card__cta:hover,
.ssm-level-card__cta:focus {
    background: var(--ssc-accent-hover);
    border-color: var(--ssc-accent-hover);
    color: var(--ssc-btn-fg);
    outline: none;
}

/* Non-featured cards use an outline CTA so the featured card's fill leads. */
.ssm-level-card:not(.ssm-level-card--featured) .ssm-level-card__cta {
    background: transparent;
    color: var(--ssc-primary);
    border-color: var(--ssc-accent);
}

.ssm-level-card:not(.ssm-level-card--featured) .ssm-level-card__cta:hover,
.ssm-level-card:not(.ssm-level-card--featured) .ssm-level-card__cta:focus {
    background: var(--ssc-surface-warm);
    color: var(--ssc-primary);
    border-color: var(--ssc-accent);
}

.ssm-level-card__after {
    font-family: var(--shell-bf, sans-serif);
    font-size: 12px;
    color: var(--ssc-surface-fg-muted);
    text-align: center;
    margin-top: 10px;
}

.ssm-level-card__cta--disabled {
    background: var(--ssc-surface);
    color: var(--ssc-surface-fg-muted);
    border-color: var(--ssc-border);
    cursor: not-allowed;
    pointer-events: none;
}

.ssm-level-card__cta--disabled:hover,
.ssm-level-card__cta--disabled:focus {
    background: var(--ssc-surface);
    color: var(--ssc-surface-fg-muted);
    border-color: var(--ssc-border);
}

.ssm-level-card__stripe-warning {
    padding: 14px 0 0;
    font-size: 13px;
    color: var(--ssc-surface-fg-muted);
    background: transparent;
    text-align: center;
}

/* ============================================================ */
/* FREE VARIANT — lean, no forced $0 hero                       */
/* ============================================================ */

.ssm-level-card--free .ssm-level-card__price-amount {
    color: var(--ssc-surface-fg);
}

/* ============================================================ */
/* RESPONSIVE                                                   */
/* ============================================================ */

@media (max-width: 480px) {
    .ssm-level-card {
        padding: 24px 20px;
    }
    .ssm-level-card__price-amount {
        font-size: 38px;
    }
}

/* ── SS-SEC002 ─────────────────────────────────────────────────────────────
   Level toggle + delete are single-button POST forms (were GET <a> links), so
   a bare GET can never mutate. These rules keep the admin controls visually
   identical: the wrapping <form> stays inline, and the toggle <button> sheds all
   UA button chrome so the Hub `.ss-toggle` primitive paints it exactly as the
   <a> did. */
.ssm-level-card-head .ssm-inline-form,
.ssm-level-row-status .ssm-inline-form,
.ssm-level-card-foot .ssm-inline-form,
.ssm-level-row-actions .ssm-inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}
button.ss-toggle {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    line-height: 0;
    cursor: pointer;
}
