.cpa-membership-notice {
	background: #FFF3CD;
	border: 1px solid #FFD100;
	border-left: 4px solid #FFD100;
	padding: 1rem 1.5rem;
	margin-bottom: 1.5rem;
	border-radius: 4px;
}

.cpa-membership-notice p {
	margin: 0;
	color: #1E3A7B;
}

/* Member Directory */
.cpa-directory__search {
    margin-bottom: 1rem;
}

.cpa-directory__search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.cpa-directory__table {
    width: 100%;
    border-collapse: collapse;
}

.cpa-directory__table th,
.cpa-directory__table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    font-size: 0.9rem;
}

.cpa-directory__table th {
    background: #1E3A7B;
    color: #fff;
    font-weight: 600;
}

.cpa-directory__table tr:hover td {
    background: #f5f7fa;
}

/* My Account */
.cpa-account-section {
    /* Was 2rem + 2rem. Four rem of dead space between fourteen sections is
       most of why this page scrolled as far as it did; the rule still reads as
       a clear break between sections at half the cost. */
    margin-bottom: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e0e0e0;
}

/* Modules that hook into this page set their own inline margins; pull them
   back in line so one section is not twice the height of its neighbour. */
#sms-alerts.cpa-account-section,
#email-preferences.cpa-account-section {
    margin-bottom: 1rem !important;
    margin-top: 1rem !important;
}

/* The jump nav follows you down instead of making you scroll back up for it.
   Matches .flyin-sub-nav in the theme, including its admin-bar offset — without
   that, a signed-in member's nav slides under the WordPress toolbar. */
.cpa-account-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-white, #fff);
}
.admin-bar .cpa-account-nav { top: 32px; }
@media screen and (max-width: 782px) {
    .admin-bar .cpa-account-nav { top: 46px; }
}

/* ── Collapsible sections ─────────────────────────────────────────────
   Applied by script rather than markup, because four different files emit
   .cpa-account-section — this class, plus the theme's SMS alerts, email
   preferences and GPS art modules hooking in. Enhancing them all from one
   place beats editing four files and keeping them in step. */
.cpa-section-toggle {
    all: unset;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    cursor: pointer;
    box-sizing: border-box;
}
.cpa-section-toggle:focus-visible { outline: 3px solid #FFD100; outline-offset: 3px; }
.cpa-section-toggle::before {
    content: "\25B8";
    font-size: 0.75em;
    color: #1E3A7B;
    transition: transform 0.15s ease;
    flex: 0 0 auto;
}
.cpa-section-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.cpa-account-section h3 > .cpa-section-toggle { font: inherit; color: inherit; }
.cpa-section-body[hidden] { display: none; }

.cpa-section-totop {
    text-align: right;
    margin: 0.75rem 0 0;
}
.cpa-section-totop a {
    font-size: 0.78rem;
    color: var(--color-text-light, #555);
    text-decoration: none;
}
.cpa-section-totop a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    .cpa-section-toggle::before { transition: none; }
}

/* Back to the top, from anywhere, at no cost in page height — the twelve
   inline links this replaces each took a line of their own. Hidden until
   there is something to scroll back from. */
.cpa-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: #1E3A7B;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(26, 26, 46, 0.3);
}
.cpa-to-top:hover,
.cpa-to-top:focus { background: #142954; color: #fff; }
.cpa-to-top:focus-visible { outline: 3px solid #FFD100; outline-offset: 2px; }
.cpa-to-top.is-visible { display: flex; }

/* Anchor jumps land under the sticky nav otherwise. */
.cpa-my-account [id] { scroll-margin-top: 4.5rem; }

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

.cpa-account-section:last-child {
    border-bottom: none;
}

.cpa-account-info th {
    text-align: left;
    padding-right: 1rem;
    font-weight: 600;
    color: #1E3A7B;
}

.cpa-status-badge {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.85rem;
}

.cpa-status-active { background: #d4edda; color: #155724; }
.cpa-status-expired { background: #f8d7da; color: #721c24; }
.cpa-status-none { background: #e2e3e5; color: #383d41; }

.cpa-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
}

/* Six visibility toggles stacked one per row is six rows for six words each.
   As a grid they fit in two, and still stack on a phone. */
.cpa-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.cpa-toggle input {
    margin-right: 0.5rem;
}

/* Content Gate CTA */
.cpa-gate {
	text-align: center;
	padding: 2.5rem 1.5rem;
	background: linear-gradient(135deg, #f8f9fa 0%, #eef1f5 100%);
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	margin: 1.5rem 0;
}
.cpa-gate--inline {
	padding: 1.5rem;
	margin: 1rem 0;
}
.cpa-gate__icon {
	font-size: 2.5rem;
	margin-bottom: 0.5rem;
}
.cpa-gate__title {
	font-size: 1.2rem;
	color: #1E3A7B;
	margin: 0 0 0.5rem;
}
.cpa-gate__desc {
	font-size: 0.92rem;
	color: #4a5568;
	max-width: 500px;
	margin: 0 auto 1.25rem;
	line-height: 1.6;
}
.cpa-gate__teaser {
	margin-bottom: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #e2e8f0;
	color: #333;
}
.cpa-gate__buttons {
	display: flex;
	justify-content: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}
.cpa-gate__btn {
	display: inline-block;
	padding: 0.6rem 1.5rem;
	border-radius: 6px;
	font-size: 0.92rem;
	font-weight: 700;
	text-decoration: none;
	transition: all 0.15s;
}
.cpa-gate__btn--join {
	background: #1E3A7B;
	color: #fff;
}
.cpa-gate__btn--join:hover {
	background: #142954;
	color: #fff;
}
.cpa-gate__btn--renew {
	background: #e8a44a;
	color: #1E3A7B;
}
.cpa-gate__btn--renew:hover {
	background: #d4922e;
	color: #1E3A7B;
}
.cpa-gate__btn--login {
	background: #fff;
	color: #1E3A7B;
	border: 2px solid #1E3A7B;
}
.cpa-gate__btn--login:hover {
	background: #f0f4fa;
	color: #1E3A7B;
}

/* Join Today Tiers */
.cpa-join-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cpa-tier-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cpa-tier-card:hover {
    border-color: #1E3A7B;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cpa-tier-card--highlight {
    border-color: #FFD100;
    border-width: 2px;
}

.cpa-tier-card__badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFD100;
    color: #1E3A7B;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.75rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.cpa-tier-card__name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #1E3A7B;
}

.cpa-tier-card__price {
    font-size: 2rem;
    font-weight: 700;
    color: #1E3A7B;
    margin-bottom: 0.25rem;
}

.cpa-tier-card__duration {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

.cpa-tier-card__btn {
    display: inline-block;
    width: 100%;
}

.cpa-join-benefits {
    background: #f5f7fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.cpa-join-benefits ul {
    columns: 2;
}

@media (max-width: 768px) {
    .cpa-join-tiers {
        grid-template-columns: 1fr;
    }

    .cpa-join-benefits ul {
        columns: 1;
    }
}

/* ═══════════════════ Touch targets (#83) ═══════════════════
 *
 * Controls across My Account sat at 23-31px. The recommended minimum is 44px
 * (Apple HIG; WCAG 2.5.8 makes 24px the floor and 44px the recommendation),
 * and this membership skews older, which makes a fiddly control cost more than
 * the numbers suggest.
 *
 * Applied on coarse pointers and narrow screens rather than everywhere: a
 * mouse does not need 44px, and forcing it on the desktop layout would stretch
 * every form for no gain.
 *
 * min-height rather than height, because the inputs carry inline padding from
 * the markup. Inline styles beat a stylesheet on the properties they set —
 * they set padding, not min-height, so this wins without needing !important.
 *
 * Checkboxes and radios are left alone. Stretching a 20px box to 44px makes a
 * misshapen control; their tap area belongs on the surrounding label.
 */
@media (pointer: coarse), (max-width: 768px) {
    .cpa-account-section input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .cpa-account-section select,
    .cpa-account-section textarea,
    .cpa-account-section button,
    .cpa-account-section .btn {
        min-height: 44px;
    }

    /* Wide already, 14px short on height. */
    .cpa-section-toggle {
        min-height: 44px;
    }

    /* A label wrapping a checkbox is the real target; give it the height. */
    .cpa-account-section label:has(> input[type="checkbox"]),
    .cpa-account-section label:has(> input[type="radio"]) {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}
