/* ───────────────────────────────────────────────
 * BR Members — Frontend Styles
 * Shared styles for shortcodes & blocks
 * ─────────────────────────────────────────────── */

.brm-subscribe-form,
.brm-unsubscribe-form {
    /* max-width: 800px;
    margin: 2em auto; */
    padding: 2em;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.brm-form-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 1.2em;
    color: #1a1a2e;
}

.brm-form-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1em;
    line-height: 1.5;
}

.brm-field {
    margin-bottom: 0.75em;
}

.brm-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    box-sizing: border-box;
}

.brm-input:focus {
    border-color: #009cd6;
    box-shadow: 0 0 0 3px rgba(0, 156, 214, 0.1);
    background: #fff;
}

.brm-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5em;
}

.brm-categories-list {
    margin: 1em 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.brm-categories-list > .brm-label {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .brm-categories-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .brm-categories-list {
        grid-template-columns: 1fr;
    }
}

/* Single category mode (when filtered via hash) */
.brm-categories-list--single {
    grid-template-columns: 1fr;
}

.brm-modal-content--single {
    max-width: 480px !important;
}

.brm-cat-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.9rem;
}

.brm-cat-option:hover {
    border-color: #009cd6;
    background: #f0faff;
}

/* ── Buttons ── */
.brm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    word-break: normal;
    border: 2px solid #009cd6;
    border-radius: 4px;
    color: #009cd6;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    box-shadow: 0 0 1.5rem rgba(169, 202, 216, 0.08);
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
    transform-origin: center center;
}

.brm-btn:hover {
    box-shadow: 0 0.375rem 0.625rem rgba(31, 167, 217, 0.2117647059);
    border-bottom: 2px solid #0076a1;
}

.brm-submit-btn {
    width: 100%;
    margin-top: 0.5em;
}

.brm-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Danger variant (unsubscribe) */
.brm-btn.brm-btn--danger {
    border-color: #dc2626;
    color: #dc2626;
}

.brm-btn.brm-btn--danger:hover {
    box-shadow: 0 0.375rem 0.625rem rgba(220, 38, 38, 0.21);
    border-bottom: 2px solid #991b1b;
}

/* ── Messages ── */
.brm-form-message {
    margin-top: 1em;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.brm-msg--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.brm-msg--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Hierarchical category groups ── */
.brm-cat-group {
    margin-bottom: 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 0 1.5rem rgba(169, 202, 216, 0.078);
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    border: none;
}

.brm-cat-group__header {
    padding: 10px 14px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e8ecf1;
}

.brm-cat-group__title {
    font-size: 0.9rem;
    color: #1e293b;
    display: block;
}

.brm-cat-group__desc {
    font-size: 0.8rem;
    color: #94a3b8;
    display: block;
    margin-top: 2px;
}

.brm-cat-group__children {
    padding: 4px 0;
}

.brm-cat-group__children .brm-cat-option--child {
    margin: 0;
    border: none;
    border-radius: 0;
    padding: 6px 14px 6px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.brm-cat-group__children .brm-cat-option--child:last-child {
    border-bottom: none;
}

/* ── Consistent checkbox size ── */
.brm-cat-option input[type="checkbox"],
.brm-cat-group__children input[type="checkbox"] {
    accent-color: #009cd6;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.brm-cat-option--all {
    margin-top: 0;
    grid-column: 1 / -1;
    border-color: #fecaca;
    background: #fef2f2;
}

.brm-cat-option--all:hover {
    border-color: #dc2626;
    background: #fee2e2;
}

/* Select all (subscribe) — blue variant */
.brm-cat-option--select-all {
    border-color: #b3e0f2;
    background: #e5f5fb;
}

.brm-cat-option--select-all:hover {
    border-color: #009cd6;
    background: #d0edfa;
}

/* ── Subscribe Button trigger ── */
.brm-subscribe-button-wrapper {
    display: inline-block;
}

.brm-modal-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    border: 2px solid #009cd6;
    border-radius: 4px;
    color: #009cd6;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 0 1.5rem rgba(169, 202, 216, 0.08);
    transition: box-shadow 0.2s ease-in-out;
}

.brm-modal-trigger:hover {
    box-shadow: 0 0.375rem 0.625rem rgba(31, 167, 217, 0.2117647059);
    border-bottom: 2px solid #0076a1;
    color: #009cd6;
}

.brm-modal-link {
    color: #009cd6;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.15s;
}

.brm-modal-link:hover {
    color: #0076a1;
}

/* ── Modal overlay ── */
.brm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2147483646 !important;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.brm-modal-overlay.is-visible {
    display: block;
    opacity: 1;
}

/* ── Modal content box ── */
.brm-modal-content {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: 90% !important;
    max-width: 800px !important;
    max-height: 90vh !important;
    background: #fff !important;
    border-radius: 10px !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 2147483647 !important;
    transform: translate(-50%, -50%) scale(0.2) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition:
        transform  0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity    0.28s ease,
        visibility 0s   linear 0.42s !important;
}

.brm-modal-content.is-visible {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition:
        transform  0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity    0.28s ease,
        visibility 0s   linear 0s !important;
}

.brm-modal-content.is-closing {
    transform: translate(-50%, -50%) scale(0.15) !important;
    opacity: 0 !important;
    visibility: visible !important;
    pointer-events: none !important;
    transition:
        transform  0.28s cubic-bezier(0.55, 0, 1, 0.45),
        opacity    0.22s ease !important;
}

/* ── Modal header ── */
.brm-modal-header {
    width: 100%;
    position: relative;
    background-color: #e5f5fb;
    padding: 16px 24px;
    padding-right: 50px;
    border-bottom: 2px solid #009dd9;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

.brm-modal-header > div {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.brm-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1a1a2e;
    text-align: left;
}

/* ── Close button ── */
.brm-modal-close {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    border: none;
    background: none;
    color: inherit;
    line-height: 1;
}

.brm-modal-close:hover {
    opacity: 1;
}

/* ── Modal scrollable body ── */
.brm-modal-scroll {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .brm-modal-content {
        width: 94% !important;
        max-height: 85vh !important;
    }
    .brm-modal-scroll {
        padding: 18px;
    }
}

@media (max-width: 480px) {
    .brm-modal-header {
        padding: 12px 16px;
    }
    .brm-modal-close {
        font-size: 18px;
    }
}