/**
 * Membership Plan Selector — BuddyBoss Platform Registration
 *
 * Styles for the plan selection radio cards injected into the
 * Platform registration form via bp_after_signup_profile_fields hook.
 *
 * Supports Membership Groups (with nested plans) and standalone plans.
 *
 * @package BuddyBoss Membership
 * @subpackage Brand
 */

/* -------------------------------------------------------
   Section wrapper — matches .register-section spacing
   ------------------------------------------------------- */
.bbms-plan-selection {
    margin-bottom: 20px;
}

.bbms-plan-selection h2 {
    font-size: 100% !important;
    margin-bottom: 15px !important;
}

/* -------------------------------------------------------
   Card grid
   ------------------------------------------------------- */
.bbms-plan-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* -------------------------------------------------------
   Individual plan card (used for both grouped & standalone)
   ------------------------------------------------------- */
.bbms-plan-card {
    display: flex !important;
    align-items: flex-start;
    padding: 16px 20px;
    border: 2px solid #e2e4e7;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

.bbms-plan-card:hover {
    border-color: #a0a5aa;
}

.bbms-plan-card.bbms-plan-selected {
    border-color: var(--bb-primary-color, #e0623d);
    box-shadow: 0 0 0 1px var(--bb-primary-color, #e0623d);
}

/* Keep the radio visible and accessible */
.bbms-plan-card input[type="radio"] {
    flex-shrink: 0;
    margin: 3px 12px 0 0;
    accent-color: var(--bb-primary-color, #e0623d);
    width: auto;
}

/* Card content */
.bbms-plan-card-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.bbms-plan-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e2327;
    line-height: 1.4;
}

.bbms-plan-price {
    font-size: 14px;
    font-weight: 500;
    color: #50575e;
    line-height: 1.4;
}

.bbms-plan-payment-note {
    font-size: 12px;
    color: #85888c;
    font-style: italic;
    line-height: 1.4;
}

/* -------------------------------------------------------
   Membership Group wrapper
   ------------------------------------------------------- */
.bbms-plan-group {
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.bbms-plan-group.bbms-plan-group-active {
    border-color: var(--bb-primary-color, #e0623d);
}

/* Group header (clickable to expand/collapse) */
.bbms-plan-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.bbms-plan-group-header:hover {
    background: #f0f1f3;
}

.bbms-group-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e2327;
    line-height: 1.4;
}

/* Toggle arrow */
.bbms-group-toggle::after {
    content: "\25BC"; /* ▼ */
    font-size: 11px;
    color: #85888c;
    transition: transform 0.2s ease;
    display: inline-block;
}

.bbms-plan-group.bbms-plan-group-collapsed .bbms-group-toggle::after {
    transform: rotate(-90deg);
}

/* Nested plans container */
.bbms-plan-group-plans {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 16px;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

/* Collapsed state */
.bbms-plan-group.bbms-plan-group-collapsed .bbms-plan-group-plans {
    display: none;
}

/* Nested cards get slightly smaller padding */
.bbms-plan-group-plans .bbms-plan-card {
    padding: 14px 16px;
}

/* -------------------------------------------------------
   Validation error styling — matches BP nouveau display
   ------------------------------------------------------- */
.bbms-plan-selection .bp-messages.bp-feedback {
    margin-bottom: 12px;
}

/* -------------------------------------------------------
   Responsive — stack nicely on mobile
   ------------------------------------------------------- */
@media (max-width: 480px) {
    .bbms-plan-card {
        padding: 12px 14px;
    }

    .bbms-plan-name {
        font-size: 14px;
    }

    .bbms-plan-price {
        font-size: 13px;
    }

    .bbms-plan-group-header {
        padding: 12px 14px;
    }

    .bbms-group-name {
        font-size: 15px;
    }

    .bbms-plan-group-plans {
        padding: 0 10px 12px;
        gap: 8px;
    }
}
