/**
 * Frontend styles for AIM-POS Membership Connection
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Montserrat:wght@400;600;700&display=swap');

.aimpos-memberships-page {
    margin: 20px 0;
}

.aimpos-membership-group {
    margin-bottom: 40px;
}

.aimpos-group-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.aimpos-memberships-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.aimpos-membership-card {
    border: 0;
    border-radius: 8px;
    padding: 20px;
    background: var(--aimpos-theme-bg, #0b1220);
    color: var(--aimpos-theme-fg, #ffffff);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: box-shadow 0.3s ease;
}

.aimpos-membership-card:hover {
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
}

.aimpos-membership-image {
    margin-bottom: 15px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aimpos-membership-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* Placeholder when no membership image is set (add in AIM-POS > Membership > Images) */
.aimpos-membership-image-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.aimpos-membership-placeholder-text {
    font-size: 48px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.aimpos-membership-image-placeholder.aimpos-tier-gold {
    background: linear-gradient(135deg, #d4af37 0%, #f4e4a6 100%);
    color: #333;
}

.aimpos-membership-image-placeholder.aimpos-tier-platinum {
    background: linear-gradient(135deg, #e5e4e2 0%, #a8a9ad 100%);
    color: #333;
}

.aimpos-membership-image-placeholder.aimpos-tier-elite {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    color: #fff;
}

.aimpos-membership-image-placeholder .aimpos-membership-placeholder-text {
    color: inherit;
}

.aimpos-membership-content {
    text-align: center;
}

.aimpos-membership-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.aimpos-membership-header .aimpos-membership-title {
    margin: 0;
    width: 100%;
}

/*
 * Fixed-height slot (matches admin tier header size) so short logos and tall letter
 * badges use the same vertical space — titles/prices line up across columns.
 */
.aimpos-membership-header-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--aimpos-tier-header-visual-size, 120px);
    height: var(--aimpos-tier-header-visual-size, 120px);
    flex-shrink: 0;
    box-sizing: border-box;
}

.aimpos-membership-header-visual .aimpos-membership-visual-img {
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.aimpos-membership-header-visual .aimpos-tier-fallback-badge {
    width: min(100%, var(--aimpos-tier-header-visual-size, 120px));
    height: min(100%, var(--aimpos-tier-header-visual-size, 120px));
    max-width: 100%;
    max-height: 100%;
}

.aimpos-membership-visual-img {
    width: var(--aimpos-tier-header-visual-size, 52px);
    height: var(--aimpos-tier-header-visual-size, 52px);
    border-radius: 50%;
    /* Use contain so larger images don't get cropped inside the circle. */
    object-fit: contain;
    flex-shrink: 0;
}

/* First-letter circled fallback badge when no image is configured. */
.aimpos-tier-fallback-badge {
    width: var(--aimpos-tier-header-visual-size, 52px);
    height: var(--aimpos-tier-header-visual-size, 52px);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Admin-configured tier color fills the circle (see membership-card.php). */
    border: 2px solid rgba(255, 255, 255, 0.22);
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 55%),
        var(--aimpos-tier-fallback-color, #999999);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.aimpos-tier-fallback-letter {
    font-size: var(--aimpos-tier-fallback-letter-size, 22px);
    font-weight: 800;
    color: var(--aimpos-tier-fallback-letter-color, #ffffff);
    line-height: 1;
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.aimpos-membership-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.aimpos-membership-card .aimpos-membership-title {
    color: var(--aimpos-theme-fg, #ffffff);
    font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 14px;
    font-weight: 700;
}

.aimpos-membership-tier {
    margin-bottom: 15px;
}

.aimpos-membership-card .aimpos-membership-tier {
    display: none;
}

.aimpos-tier-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin-right: 10px;
    color: #fff;
}

.aimpos-tier-gold {
    background-color: #ffd700;
    color: #333;
}

.aimpos-tier-platinum {
    background-color: #e5e4e2;
    color: #333;
}

.aimpos-tier-elite {
    background-color: #000;
    color: #fff;
}

.aimpos-duration-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    background-color: #f0f0f0;
    color: #333;
}

.aimpos-membership-card .aimpos-membership-duration-under-price {
    font-size: 13px;
    color: var(--aimpos-theme-fg, #ffffff);
    opacity: 0.75;
    margin: 6px 0 10px 0;
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    text-align: center;
}

.aimpos-membership-pricing {
    margin: 20px 0;
}

.aimpos-price-label {
    font-size: 14px;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.aimpos-membership-card .aimpos-price-label {
    display: none;
}

.aimpos-price-amount {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.aimpos-membership-card .aimpos-price-amount {
    font-size: 44px;
    color: var(--aimpos-theme-fg, #ffffff);
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 700;
    line-height: 1.1;
}

.aimpos-price-strikethrough {
    text-decoration: line-through;
    color: #999;
    font-size: 18px;
}

.aimpos-price-member {
    color: #28a745;
}

.aimpos-initiation-fee {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.aimpos-membership-card .aimpos-initiation-fee {
    display: block;
    min-height: 56px;
    margin-top: 6px;
    color: var(--aimpos-theme-fg, #ffffff);
    opacity: 0.9;
    text-align: center;
}

.aimpos-membership-card .aimpos-initiation-fee.is-empty {
    visibility: hidden;
}

.aimpos-membership-card .aimpos-initiation-fee .aimpos-price-label {
    display: block;
    color: var(--aimpos-theme-fg, #ffffff);
    opacity: 0.75;
    font-size: 12px;
    margin: 0 0 2px 0;
}

.aimpos-membership-card .aimpos-initiation-fee .aimpos-price-amount {
    font-size: 20px;
    line-height: 1.2;
}

.aimpos-membership-benefits {
    margin: 20px 0;
    text-align: left;
}

.aimpos-membership-benefits h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.aimpos-membership-card .aimpos-membership-benefits {
    margin-top: 16px;
}

.aimpos-membership-card .aimpos-membership-benefits h4 {
    display: none;
}

.aimpos-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aimpos-benefits-list li.aimpos-benefit-item {
    padding: 5px 0;
    position: relative;
}

.aimpos-benefit-inner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    justify-content: flex-start;
}

/* When a benefit has an optional image, keep text + checkmark first and let copy wrap; icon stays after. */
.aimpos-benefit-inner:has(.aimpos-benefit-icon) .aimpos-benefit-label {
    /* Avoid flex-grow here: otherwise the label stretches and pushes the icon
       to the far right of the container. */
    flex: 0 1 auto;
    min-width: 0;
}

.aimpos-benefit-icon-img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    flex-shrink: 0;
}

.aimpos-benefit--checkmark .aimpos-benefit-label::before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    margin-right: 6px;
}

.aimpos-membership-card .aimpos-benefit--checkmark .aimpos-benefit-label::before {
    color: #f97316;
}

.aimpos-benefit--bullet .aimpos-benefit-label::before {
    content: "•";
    color: #333;
    font-weight: bold;
    margin-right: 6px;
}

.aimpos-membership-card .aimpos-benefit--bullet .aimpos-benefit-label::before {
    color: #f97316;
}

/* Explicit label color so dark-page themes (e.g. white inherited text) do not hide copy on white cards */
.aimpos-benefit-label {
    color: #1d2327;
}

.aimpos-membership-card .aimpos-benefit-label {
    color: var(--aimpos-theme-fg, #ffffff);
}

.aimpos-membership-max-subs {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.aimpos-membership-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.aimpos-membership-card .aimpos-membership-actions {
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.aimpos-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.aimpos-btn-primary {
    background-color: #0073aa;
    color: #fff;
}

.aimpos-membership-card .aimpos-btn-primary {
    background-color: var(--aimpos-cta-bg, #f97316);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 13px;
    padding: 14px 28px;
    border-radius: 4px;
    font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.aimpos-btn-primary:hover {
    background-color: #005a87;
}

.aimpos-membership-card .aimpos-btn-primary:hover {
    background-color: var(--aimpos-cta-bg-hover, #ea580c);
}

.aimpos-btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.aimpos-membership-card .aimpos-btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(249, 115, 22, 0.65);
}

.aimpos-btn-secondary:hover {
    background-color: #e0e0e0;
}

.aimpos-membership-card .aimpos-btn-secondary:hover {
    background: rgba(249, 115, 22, 0.08);
    color: #fff;
}

/* Modal Styles */
.aimpos-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.aimpos-modal-content {
    background-color: #fefefe;
    color: #1d2327;
    margin: 4vh auto;
    padding: 20px;
    border: 1px solid #888;
    width: 92%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-sizing: border-box;
    border-radius: 8px;
    position: relative;
}

.aimpos-modal-content h2 {
    margin-top: 0;
    padding-right: 2rem;
}

#aimpos-gift-modal .aimpos-modal-content h2 {
    color: #1d2327 !important;
}

.aimpos-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.aimpos-modal-close:hover,
.aimpos-modal-close:focus {
    color: #000;
}

/* Gift Form Styles */
.aimpos-gift-form {
    margin-top: 20px;
}

.aimpos-gift-form .form-row {
    margin-bottom: 15px;
}

.aimpos-modal-content .aimpos-gift-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #1d2327;
}

/* Beat theme/WooCommerce rules that style .form-row-first/.form-row-last labels differently */
#aimpos-gift-modal .aimpos-gift-form label {
    color: #1d2327 !important;
}

.aimpos-gift-form .required {
    color: #d63638;
}

.aimpos-gift-form input[type="text"],
.aimpos-gift-form input[type="email"],
.aimpos-gift-form input[type="tel"],
.aimpos-gift-form select,
.aimpos-gift-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #1d2327;
    background-color: #fff;
}

#aimpos-gift-modal .aimpos-gift-form input[type="text"],
#aimpos-gift-modal .aimpos-gift-form input[type="email"],
#aimpos-gift-modal .aimpos-gift-form input[type="tel"],
#aimpos-gift-modal .aimpos-gift-form select,
#aimpos-gift-modal .aimpos-gift-form textarea {
    color: #1d2327 !important;
    background-color: #fff !important;
}

.aimpos-gift-form .form-row-first,
.aimpos-gift-form .form-row-last {
    width: 48%;
    display: inline-block;
}

.aimpos-gift-form .form-row-first {
    margin-right: 4%;
}

/* Message Styles */
.aimpos-message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.aimpos-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.aimpos-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.aimpos-error {
    color: #d63638;
    font-weight: bold;
}

/* Columns layout (by tier) */
.aimpos-layout-columns .aimpos-memberships-columns {
    display: grid;
    grid-template-columns: repeat(var(--aimpos-columns-per-row, 4), minmax(0, 1fr));
    /* Wider horizontal gutter so adjacent tier columns have clearer separation. */
    row-gap: 24px;
    column-gap: 36px;
    margin-top: 20px;
}

.aimpos-tier-column {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: var(--aimpos-theme-bg, #0b1220);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    color: var(--aimpos-theme-fg, #ffffff);
}

.aimpos-tier-column-title {
    font-size: 22px;
    font-weight: bold;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--aimpos-tier-title-color, #ddd);
    text-align: center;
    color: var(--aimpos-tier-title-color, var(--aimpos-theme-fg, #ffffff));
}

.aimpos-tier-column-subtitle {
    font-size: 14px;
    font-weight: normal;
    color: var(--aimpos-tier-title-color, var(--aimpos-theme-fg, #ffffff));
    opacity: 0.75;
}

.aimpos-tier-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.aimpos-tier-benefits li.aimpos-benefit-item {
    padding: 6px 0;
    position: relative;
}

.aimpos-tier-signup {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.aimpos-tier-type-section {
    margin-bottom: 16px;
}

.aimpos-layout-columns .aimpos-tier-type-section + .aimpos-tier-type-section {
    /* Extra separation between "Individual membership" and "Group membership" blocks. */
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.aimpos-tier-type-section:last-child {
    margin-bottom: 0;
}

.aimpos-tier-type-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.aimpos-tier-pricing-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.aimpos-tier-benefits--nested {
    /* Nested benefits sit directly above pricing buttons; keep this tight. */
    margin-bottom: 6px;
}

.aimpos-tier-duration-group {
    margin-bottom: 12px;
}

.aimpos-tier-duration-group:last-child {
    margin-bottom: 0;
}

.aimpos-tier-duration-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.aimpos-price-button-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aimpos-price-btn {
    padding: 10px 16px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.aimpos-price-btn:hover {
    background: #555;
}

.aimpos-price-btn-label {
    font-weight: normal;
    opacity: 0.9;
}

/* Columns layout: match dark card + large price + orange GET NOW style */
.aimpos-layout-columns .aimpos-price-button-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.aimpos-layout-columns .aimpos-price-display {
    background: transparent;
    border-radius: 0;
    padding: 10px 0 4px;
    text-align: center;
    color: var(--aimpos-theme-fg, #ffffff);
}

.aimpos-layout-columns .aimpos-columns-tier-visual {
    margin: 0 0 6px 0;
}

.aimpos-layout-columns .aimpos-columns-tier-visual .aimpos-membership-visual-img {
    width: 36px;
    height: 36px;
}

.aimpos-layout-columns .aimpos-columns-tier-visual .aimpos-tier-fallback-badge {
    width: 36px;
    height: 36px;
    border-width: 1px;
}

.aimpos-layout-columns .aimpos-columns-tier-visual .aimpos-tier-fallback-letter {
    font-size: 16px;
}

.aimpos-layout-columns .aimpos-price-display-amount {
    display: block;
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 38px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.01em;
    color: var(--aimpos-theme-fg, #ffffff);
    transition: color 0.2s ease;
}

.aimpos-layout-columns .aimpos-price-display:hover .aimpos-price-display-amount {
    color: var(--aimpos-cta-bg, #f97316);
}

.aimpos-layout-columns .aimpos-price-display-duration {
    display: none;
}

.aimpos-layout-columns .aimpos-price-btn {
    width: 100%;
    background-color: var(--aimpos-cta-bg, #f97316);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 13px;
    font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.aimpos-layout-columns .aimpos-price-btn:hover {
    background-color: var(--aimpos-cta-bg-hover, #ea580c);
}

.aimpos-layout-columns .aimpos-price-btn-label {
    display: none;
}

.aimpos-layout-columns .aimpos-price-button-wrap .aimpos-btn-link {
    align-self: flex-end;
}

/* Make the whole tier column dark (so benefits + labels match) */
.aimpos-layout-columns .aimpos-tier-column {
    border: 0;
    background: var(--aimpos-theme-bg, #0b1220);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    color: var(--aimpos-theme-fg, #ffffff);
}

.aimpos-layout-columns .aimpos-tier-column-title {
    color: var(--aimpos-tier-title-color, var(--aimpos-theme-fg, #ffffff));
    border-bottom-color: color-mix(in srgb, var(--aimpos-tier-title-color, #ffffff) 55%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    flex-wrap: wrap;
}

.aimpos-layout-columns .aimpos-tier-column-title-visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.aimpos-layout-columns .aimpos-tier-column-title-visual .aimpos-membership-visual-img {
    width: var(--aimpos-tier-header-visual-size, 56px);
    height: var(--aimpos-tier-header-visual-size, 56px);
    /* Prevent aggressive cropping when user increases the header image size. */
    object-fit: contain;
}

.aimpos-layout-columns .aimpos-tier-column-title-visual .aimpos-tier-fallback-badge {
    width: var(--aimpos-tier-header-visual-size, 56px);
    height: var(--aimpos-tier-header-visual-size, 56px);
    border-width: 1px;
}

.aimpos-layout-columns .aimpos-tier-column-title-visual .aimpos-tier-fallback-letter {
    font-size: var(--aimpos-tier-header-fallback-letter-size, 22px);
}

.aimpos-layout-columns .aimpos-tier-column-subtitle {
    color: var(--aimpos-tier-title-color, var(--aimpos-theme-fg, #ffffff));
    opacity: 0.75;
}

.aimpos-layout-columns .aimpos-tier-type-label {
    color: var(--aimpos-theme-fg, #ffffff);
    opacity: 0.9;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 8px;
    margin: 0 0 12px 0;
}

.aimpos-layout-columns .aimpos-tier-duration-label {
    color: var(--aimpos-theme-fg, #ffffff);
    opacity: 0.75;
}

.aimpos-layout-columns .aimpos-tier-signup {
    color: var(--aimpos-theme-fg, #ffffff);
    opacity: 0.65;
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.aimpos-layout-columns .aimpos-membership-max-subs {
    color: var(--aimpos-theme-fg, #ffffff);
    opacity: 0.7;
    text-align: center;
}

.aimpos-layout-columns .aimpos-initiation-fee {
    text-align: center;
    color: var(--aimpos-theme-fg, #ffffff);
    opacity: 0.85;
    margin-top: -2px;
    min-height: 54px;
}

.aimpos-layout-columns .aimpos-initiation-fee.is-empty {
    visibility: hidden;
}

.aimpos-layout-columns .aimpos-initiation-fee-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.8;
}

.aimpos-layout-columns .aimpos-initiation-fee-amount {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
    margin-top: 2px;
}

.aimpos-layout-columns .aimpos-benefit-label {
    color: var(--aimpos-theme-fg, #ffffff);
}

.aimpos-layout-columns .aimpos-benefit--checkmark .aimpos-benefit-label::before {
    color: #f97316;
}

.aimpos-layout-columns .aimpos-benefit--bullet .aimpos-benefit-label::before {
    color: #f97316;
}

.aimpos-btn-link {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
    padding: 0;
}

.aimpos-gift-membership {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.aimpos-gift-membership.aimpos-btn-link {
    /* Override the default link style (blue/underline) so it's visible on dark cards. */
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 115, 170, 0.65);
    background: rgba(0, 115, 170, 0.18);
}

.aimpos-gift-membership.aimpos-btn-link:hover {
    color: #ffffff;
    background: rgba(0, 115, 170, 0.26);
}

.aimpos-gift-text {
    color: inherit;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.aimpos-gift-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.aimpos-gift-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

.aimpos-btn-link:hover {
    color: #005a87;
}

/* Display flow wizard (deferred type and/or duration) */
.aimpos-memberships-wizard .aimpos-wizard-heading {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--aimpos-theme-fg, #ffffff);
}

.aimpos-memberships-wizard .aimpos-wizard-subheading {
    font-size: 14px;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: var(--aimpos-theme-fg, #ffffff);
    opacity: 0.85;
}

.aimpos-memberships-wizard .aimpos-wizard-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.aimpos-memberships-wizard .aimpos-wizard-choices--tiers {
    margin-bottom: 4px;
}

.aimpos-memberships-wizard .aimpos-wizard-choice {
    padding: 12px 18px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: var(--aimpos-theme-fg, #ffffff);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.aimpos-memberships-wizard .aimpos-wizard-choice:hover {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.1);
}

.aimpos-memberships-wizard .aimpos-wizard-choice.is-selected {
    border-color: #0073aa;
    background: rgba(0, 115, 170, 0.25);
}

.aimpos-memberships-wizard .aimpos-wizard-error {
    color: #ffb4b4;
    font-size: 14px;
    margin: 12px 0 0 0;
}

.aimpos-memberships-wizard .aimpos-wizard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.aimpos-memberships-wizard .aimpos-wizard-final-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.aimpos-memberships-wizard .aimpos-wizard-final-header .aimpos-wizard-heading {
    margin: 0;
}

.aimpos-memberships-wizard .aimpos-wizard-change-selection {
    font-size: 14px;
}

.aimpos-memberships-wizard .aimpos-wizard-intro,
.aimpos-memberships-wizard .aimpos-wizard-lead {
    font-size: 15px;
    line-height: 1.5;
    color: var(--aimpos-theme-fg, #ffffff);
    opacity: 0.88;
    margin: 0 0 18px 0;
    max-width: 52em;
}

.aimpos-memberships-wizard .aimpos-wizard-choices--tier-cards {
    display: grid;
    /* Column min tracks admin tier icon size so 220px circles are not squeezed below 200px. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--aimpos-wizard-tier-card-min, 260px)), 1fr));
    gap: 16px;
    align-items: stretch;
}

.aimpos-memberships-wizard .aimpos-wizard-tier-tile {
    width: 100%;
    min-width: 0;
    padding: 16px 14px;
    text-align: center;
    min-height: 100%;
}

.aimpos-memberships-wizard .aimpos-wizard-tier-tile-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.aimpos-memberships-wizard .aimpos-wizard-tier-tile-label {
    font-size: 17px;
    font-weight: 700;
    margin-top: 4px;
}

.aimpos-memberships-wizard .aimpos-wizard-tier-tile-sub {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/*
 * Wizard tier icon: square slot capped by card width (min(admin px, 100%)).
 * Letter size uses container query units so it scales with the *rendered* circle, not a fixed px from PHP.
 */
.aimpos-wizard-tier-visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    container-type: inline-size;
    container-name: aimpos-wizard-tier-slot;
    /* Never wider than the card column; height follows width (square). */
    width: min(var(--aimpos-wizard-tier-slot, var(--aimpos-tier-header-visual-size, 72px)), 100%);
    max-width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
}

.aimpos-wizard-tier-visual-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.aimpos-wizard-tier-visual .aimpos-wizard-tier-visual-img,
.aimpos-wizard-tier-visual .aimpos-wizard-tier-visual-frame .aimpos-wizard-tier-visual-img {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    border-radius: 50%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.aimpos-wizard-tier-visual .aimpos-tier-fallback-badge {
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: hidden;
}

/* Fallback letter: ~40% of the actual slot width (cqi), stays inside the circle. */
.aimpos-wizard-tier-visual .aimpos-tier-fallback-letter {
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
    /* Fallback when container queries are not supported */
    font-size: var(--aimpos-tier-fallback-letter-size, 22px);
}

@supports (font-size: 1cqi) {
    .aimpos-wizard-tier-visual .aimpos-tier-fallback-letter {
        /* 40cqi ≈ 40% of slot width — tracks min(admin size, column width) */
        font-size: clamp(14px, 40cqi, 120px);
    }
}

.aimpos-wizard-tier-visual--compact {
    width: min(var(--aimpos-wizard-tier-slot-compact, 48px), 100%);
    max-width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
}

.aimpos-wizard-tier-visual--compact .aimpos-wizard-tier-visual-frame .aimpos-wizard-tier-visual-img {
    width: 100% !important;
    height: 100% !important;
}

@supports (font-size: 1cqi) {
    .aimpos-wizard-tier-visual--compact .aimpos-tier-fallback-letter {
        font-size: clamp(12px, 55cqi, 28px);
    }
}

.aimpos-memberships-wizard .aimpos-wizard-tier-tile-preview {
    list-style: none;
    padding: 10px 0 0 0;
    margin: 10px 0 0 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    color: #ffffff;
    opacity: 0.9;
}

.aimpos-memberships-wizard .aimpos-wizard-tier-tile-preview li {
    position: relative;
    padding: 4px 0 4px 1.1em;
    line-height: 1.35;
}

.aimpos-memberships-wizard .aimpos-wizard-tier-tile-preview li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #f58723;
    font-weight: bold;
}

.aimpos-memberships-wizard .aimpos-wizard-choices--option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.aimpos-memberships-wizard .aimpos-wizard-option-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 16px 18px;
    min-height: 100%;
}

.aimpos-memberships-wizard .aimpos-wizard-option-title {
    display: block;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.aimpos-memberships-wizard .aimpos-wizard-option-desc {
    display: block;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.75;
    line-height: 1.4;
}

.aimpos-memberships-wizard .aimpos-wizard-recap {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.aimpos-memberships-wizard .aimpos-wizard-recap-tier .aimpos-wizard-tier-tile-inner {
    flex-direction: row;
    align-items: center;
    width: 100%;
    text-align: left;
    gap: 12px;
}

.aimpos-memberships-wizard .aimpos-wizard-recap-tier .aimpos-wizard-tier-tile-label {
    margin-top: 0;
}

.aimpos-memberships-wizard .aimpos-wizard-recap-tier .aimpos-wizard-tier-tile-sub {
    display: none;
}

.aimpos-memberships-wizard .aimpos-wizard-recap-line {
    margin: 10px 0 0 0;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
}

.aimpos-memberships-wizard .aimpos-wizard-recap-duration::before {
    content: 'Billing: ';
    opacity: 0.65;
    font-weight: 500;
}

.aimpos-memberships-wizard .aimpos-wizard-recap-type::before {
    content: 'Type: ';
    opacity: 0.65;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .aimpos-memberships-grid {
        grid-template-columns: 1fr;
    }

    .aimpos-membership-actions {
        flex-direction: column;
    }

    .aimpos-layout-columns .aimpos-memberships-columns {
        grid-template-columns: 1fr;
    }

    .aimpos-gift-form .form-row-first,
    .aimpos-gift-form .form-row-last {
        width: 100%;
        margin-right: 0;
    }

    .aimpos-memberships-wizard .aimpos-wizard-choices--tier-cards,
    .aimpos-memberships-wizard .aimpos-wizard-choices--option-cards {
        grid-template-columns: 1fr;
    }
}
