/**
 * R33 Member Preferences — module styles.
 *
 * Uses shared design tokens from dashboard-base.css:
 *   .r33-module       — outer panel + h2 styling
 *   .r33-module-hint  — short intro paragraph
 *   .r33-notice       — info / warning callout cards
 *   .r33-save-btn     — save button (gold-on-dark, uppercase)
 *   .r33-field        — form field row with label + input styling
 *
 * Only adds module-specific patterns the shared system doesn't cover:
 *   .r33-member-prefs__group     — fieldset card section
 *   .r33-member-prefs__legend    — section label
 *   .r33-member-prefs__pill-grid — selectable chip container
 *   .r33-member-prefs__pill      — individual selectable chip
 *
 * Markup contract: native <input> stays in DOM (sr-only) so screen
 * readers + form submission keep working. The visible chip is the
 * <label> wrapper; selection state via :has(input:checked).
 */

/* ── Benefit lists inside notices ──────────────────────────────── */
.r33-member-prefs__benefits {
    margin: 6px 0 10px;
    padding-left: 22px;
    list-style: disc;
    line-height: 1.7;
}

.r33-member-prefs__benefits li {
    margin: 0;
}

/* ── Card section (fieldset) ───────────────────────────────────── */
.r33-member-prefs__group {
    background: #161616;
    border: 1px solid #232323;
    border-radius: 8px;
    padding: 16px 20px 20px;
    margin: 0 0 14px;
    transition: border-color 160ms ease;
}

.r33-member-prefs__group:hover {
    border-color: #2c2c2c;
}

.r33-member-prefs__legend {
    padding: 0 6px;
    margin-left: -6px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #c9a84c;
    background: transparent;
}

/* ── Pill grid ─────────────────────────────────────────────────── */
.r33-member-prefs__pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.r33-member-prefs__pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border: 1px solid #2a2a2a;
    border-radius: 999px;
    background: #0e0e0e;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    line-height: 1.2;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

/* Hide native input visually but keep accessible (sr-only pattern) */
.r33-member-prefs__pill > input[type="checkbox"],
.r33-member-prefs__pill > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    pointer-events: none;
}

.r33-member-prefs__pill > span {
    display: inline-block;
}

.r33-member-prefs__pill:hover {
    border-color: #c9a84c;
    color: #fff;
}

.r33-member-prefs__pill:has(input:checked) {
    background: rgba(201, 168, 76, 0.14);
    border-color: #c9a84c;
    color: #f0d889;
    font-weight: 600;
}

.r33-member-prefs__pill:has(input:focus-visible) {
    outline: 2px solid #c9a84c;
    outline-offset: 2px;
}

.r33-member-prefs__pill:has(input:disabled) {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Age range — uses shared .r33-field for input styling ─────── */
.r33-member-prefs__range {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 12px;
}

.r33-member-prefs__range .r33-field {
    margin-bottom: 0;
    width: 140px;
}

/* ── Action bar ────────────────────────────────────────────────── */
.r33-member-prefs__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
}

.r33-member-prefs__status {
    font-size: 13px;
    color: #fff;
    min-height: 1em;
}

.r33-member-prefs__status[data-state="success"] {
    color: #4ade80;
    font-weight: 600;
}

.r33-member-prefs__status[data-state="error"] {
    color: #f87171;
    font-weight: 600;
}

.r33-member-prefs__status[data-state="pending"] {
    color: #fff;
    opacity: 0.85;
}

/* ── Trailing "what happens after I save?" notice spacing ──── */
.r33-member-prefs__after {
    margin-top: 28px;
    margin-bottom: 0;
}

/* ── Mobile-first responsive ───────────────────────────────────── */
@media (max-width: 600px) {
    .r33-member-prefs__group {
        padding: 14px 14px 16px;
    }

    .r33-member-prefs__pill {
        padding: 9px 14px;
        font-size: 13px;
        min-height: 38px;
    }

    .r33-member-prefs__range {
        gap: 12px;
    }

    .r33-member-prefs__range .r33-field {
        width: calc(50% - 6px);
    }

    .r33-member-prefs__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .r33-member-prefs__actions .r33-save-btn {
        width: 100%;
        text-align: center;
    }

    .r33-member-prefs__status {
        text-align: center;
    }
}
