/* =============================================
   AMAC Member Portal Styles
   Extends the main design system for member pages
   ============================================= */

/* -----------------------------------------
   1. MEMBER LAYOUT
   ----------------------------------------- */
.member-layout {
    display: flex;
    min-height: calc(100vh - 200px);
}

.member-main {
    flex: 1;
    padding: var(--space-8) var(--space-6);
    max-width: 1000px;
}

/* Auth pages (login, register, etc.) - centered layout */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: var(--space-8) var(--space-4);
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--color-white) 100%);
}

/* -----------------------------------------
   2. SIDEBAR NAVIGATION
   ----------------------------------------- */
.member-sidebar {
    width: 280px;
    background: var(--color-white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.member-sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.member-sidebar-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--color-white);
    border: 2px solid var(--gray-200);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-3);
    overflow: hidden;
}

/* When showing initials, use dark background */
.member-sidebar-avatar.has-initials {
    background: var(--color-liberty-blue);
    border-color: var(--color-liberty-blue);
}

.member-sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-sidebar-name {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-charcoal);
    margin-bottom: var(--space-1);
}

.member-sidebar-id {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.member-sidebar-nav {
    flex: 1;
    padding: var(--space-4) 0;
}

.member-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    color: var(--gray-700);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    transition: all var(--duration-150) var(--ease-in-out);
    border-left: 3px solid transparent;
}

.member-sidebar-nav a:hover {
    background: var(--gray-50);
    color: var(--color-liberty-blue);
}

.member-sidebar-nav a.active {
    background: var(--blue-50);
    color: var(--color-liberty-blue);
    border-left-color: var(--color-liberty-blue);
    font-weight: var(--font-semibold);
}

.member-sidebar-nav a svg,
.member-sidebar-nav span svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Disabled nav item (Coming soon) */
.member-sidebar-nav span[title="Coming soon"] {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    color: var(--gray-400);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.member-sidebar-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--gray-200);
}

.member-logout-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    color: var(--gray-600);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
    transition: all var(--duration-150) var(--ease-in-out);
}

.member-logout-btn:hover {
    background: var(--red-50);
    color: var(--color-patriot-red);
}

.member-logout-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* -----------------------------------------
   2b. SUPPORT PHONE BANNER - Friendly Human Touch
   ----------------------------------------- */
.support-phone-banner {
    position: relative;
    margin: var(--space-4);
    padding: var(--space-5);
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 40, 104, 0.06);
}

.support-phone-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 40, 104, 0.1);
    border-color: var(--gray-300);
}

/* Avatar stack */
.support-avatars {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-3);
}

.support-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    margin-left: -10px;
    transition: transform 0.2s ease;
}

.support-avatar:first-child {
    margin-left: 0;
}

.support-phone-banner:hover .support-avatar {
    transform: translateY(-2px);
}

.support-avatar:nth-child(1) { z-index: 3; }
.support-avatar:nth-child(2) { z-index: 2; }
.support-avatar:nth-child(3) { z-index: 1; }

/* Section label */
.support-phone-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-600);
    margin-bottom: var(--space-2);
}

/* Phone number - HERO element */
.support-phone-number {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-liberty-blue);
    text-decoration: none;
    margin-bottom: var(--space-2);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.support-phone-number:hover {
    color: var(--color-amac-red);
}

.support-phone-number svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    flex-shrink: 0;
    fill: currentColor;
}

/* Hours text */
.support-phone-hours {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: var(--space-3);
}

/* US-Based Staff badge */
.support-phone-banner .us-staff-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: var(--color-liberty-blue);
    font-size: 10px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--gray-200);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.support-phone-banner:hover .us-staff-badge {
    border-color: var(--color-liberty-blue);
    box-shadow: 0 2px 6px rgba(0, 40, 104, 0.1);
}

.support-phone-banner .us-staff-badge .flag-icon {
    width: 16px;
    height: 12px;
}

/* -----------------------------------------
   3. HEADER MEMBER DROPDOWN
   ----------------------------------------- */
.member-dropdown {
    position: relative;
}

.member-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    color: var(--color-liberty-blue, #002868) !important;
    background: transparent;
    border-radius: var(--radius-md);
    transition: background var(--duration-150) var(--ease-in-out);
}

.member-dropdown-toggle:hover {
    background: var(--gray-100, #f3f4f6);
}

.member-avatar-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.member-greeting {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.member-chevron {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform var(--duration-200) var(--ease-in-out);
}

.member-dropdown-toggle[aria-expanded="true"] .member-chevron {
    transform: rotate(180deg);
}

.member-dropdown-menu {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    width: 240px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--duration-200) var(--ease-out);
    z-index: var(--z-50);
    overflow: hidden;
}

.member-dropdown-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.member-dropdown-header {
    padding: var(--space-4);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.member-dropdown-header .member-name {
    display: block;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-charcoal);
}

.member-dropdown-header .member-id {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

.member-dropdown-nav {
    padding: var(--space-2) 0;
}

.member-dropdown-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--gray-700);
    font-size: var(--text-sm);
    transition: all var(--duration-150) var(--ease-in-out);
}

.member-dropdown-nav a:hover {
    background: var(--gray-50);
    color: var(--color-liberty-blue);
}

.member-dropdown-nav a svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.member-dropdown-footer {
    padding: var(--space-2) var(--space-4);
    border-top: 1px solid var(--gray-200);
}

.member-dropdown-footer .member-logout-btn {
    width: 100%;
    justify-content: flex-start;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
}

/* -----------------------------------------
   4. AUTH CARD (Login, Register, etc.)
   ----------------------------------------- */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.auth-card-header {
    padding: var(--space-8) var(--space-8) var(--space-6);
    text-align: center;
    background: var(--color-white);
}

.auth-card-logo {
    width: 160px;
    height: auto;
    margin: 0 auto var(--space-6);
}

.auth-card-title {
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-liberty-blue);
    margin-bottom: var(--space-2);
}

.auth-card-subtitle {
    font-size: var(--text-base);
    color: var(--gray-600);
}

.auth-card-body {
    padding: var(--space-2) var(--space-8) var(--space-8);
}

.auth-card-footer {
    padding: var(--space-6) var(--space-8);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.auth-card-footer p {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin: 0;
}

.auth-card-footer a {
    color: var(--color-liberty-blue);
    font-weight: var(--font-semibold);
}

.auth-card-footer a:hover {
    text-decoration: underline;
}

/* Auth Call Center Banner (FR-AUTH-041) */
.auth-call-banner {
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-top: var(--space-6);
    text-align: center;
}

.auth-call-banner-title {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-bottom: var(--space-2);
}

.auth-call-banner-phone {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-liberty-blue);
    text-decoration: none;
}

.auth-call-banner-phone:hover {
    color: var(--color-patriot-red);
}

.auth-call-banner-phone svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.auth-call-banner-hours {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-top: var(--space-1);
}

/* Smart Hint for Email-First Routing (FR-AUTH-031) */
.smart-hint {
    margin-top: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-hint.hint-existing {
    background: var(--green-50, #f0fdf4);
    border: 1px solid var(--green-200, #bbf7d0);
    color: var(--green-800, #166534);
}

.smart-hint.hint-new {
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    color: var(--color-liberty-blue);
}

.smart-hint a {
    color: inherit;
    font-weight: var(--font-semibold);
    text-decoration: underline;
}

/* -----------------------------------------
   5. FORM STYLES
   ----------------------------------------- */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-charcoal);
    margin-bottom: var(--space-2);
}

.form-label-optional {
    font-weight: var(--font-normal);
    color: var(--gray-600);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base); /* 16px prevents iOS zoom */
    font-family: var(--font-sans);
    color: var(--color-charcoal);
    background: var(--color-white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all var(--duration-150) var(--ease-in-out);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--gray-400);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-liberty-blue);
    box-shadow: 0 0 0 3px var(--blue-100);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
    border-color: var(--color-patriot-red);
    background: var(--red-50);
}

.form-input.is-error:focus,
.form-select.is-error:focus,
.form-textarea.is-error:focus {
    box-shadow: 0 0 0 3px var(--red-100);
}

.form-input.is-success {
    border-color: #22c55e;
    background: #f0fdf4;
}

/* Password input with toggle */
.form-input-wrapper {
    position: relative;
}

.form-input-wrapper .form-input {
    padding-right: var(--space-12);
}

.form-password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    padding: var(--space-2);
    color: var(--gray-500);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-md);
}

.form-password-toggle:hover {
    color: var(--color-liberty-blue);
}

.form-password-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Form hint/help text */
.form-hint {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-top: var(--space-2);
}

/* Form error message */
.form-error {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-patriot-red);
    margin-top: var(--space-2);
}

.form-error svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Checkbox and radio */
.form-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.form-checkbox {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--color-liberty-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.form-checkbox-label {
    font-size: var(--text-sm);
    color: var(--gray-700);
    cursor: pointer;
    line-height: 1.4;
}

.form-checkbox-label a {
    color: var(--color-liberty-blue);
    font-weight: var(--font-medium);
}

.form-checkbox-label a:hover {
    text-decoration: underline;
}

/* Form row (multiple inputs) */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Form select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: var(--space-10);
}

/* Form textarea */
.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* -----------------------------------------
   6. BUTTONS
   ----------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    line-height: 1.5;
    text-align: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-150) var(--ease-in-out);
    border: 2px solid transparent;
    min-height: 48px; /* 48px minimum touch target */
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-patriot-red);
    color: var(--color-white);
    border-color: var(--color-patriot-red);
}

.btn-primary:hover:not(:disabled) {
    background: var(--red-700);
    border-color: var(--red-700);
}

.btn-primary:active:not(:disabled) {
    background: var(--red-800);
    border-color: var(--red-800);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-liberty-blue);
    border-color: var(--color-liberty-blue);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--blue-50);
}

.btn-secondary:active:not(:disabled) {
    background: var(--blue-100);
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-outline:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-link {
    background: transparent;
    color: var(--color-liberty-blue);
    border: none;
    padding: var(--space-2);
    min-height: auto;
}

.btn-link:hover:not(:disabled) {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    min-height: 40px;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
    min-height: 56px;
}

.btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* -----------------------------------------
   7. ALERTS & NOTIFICATIONS
   ----------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.alert-error {
    background: var(--red-50);
    border: 1px solid var(--red-200);
    color: var(--red-700);
}

.alert-error .alert-icon {
    fill: var(--color-patriot-red);
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert-success .alert-icon {
    fill: #22c55e;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-warning .alert-icon {
    fill: #f59e0b;
}

.alert-info {
    background: var(--blue-50);
    border: 1px solid var(--blue-200);
    color: var(--blue-700);
}

.alert-info .alert-icon {
    fill: var(--blue-500);
}

/* -----------------------------------------
   8. PAGE HEADERS
   ----------------------------------------- */
.page-header {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
}

.page-title {
    font-family: var(--font-serif);
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--color-liberty-blue);
    margin-bottom: var(--space-2);
}

.page-subtitle {
    font-size: var(--text-lg);
    color: var(--gray-600);
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-bottom: var(--space-4);
}

.page-breadcrumb a {
    color: var(--color-liberty-blue);
}

.page-breadcrumb a:hover {
    text-decoration: underline;
}

.page-breadcrumb svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* -----------------------------------------
   9. CARDS & PANELS
   ----------------------------------------- */
.card {
    background: var(--color-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-charcoal);
    margin: 0;
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Stat cards */
.stat-card {
    padding: var(--space-5);
    background: var(--color-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-card-value {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--color-liberty-blue);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-card-label {
    font-size: var(--text-sm);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

/* -----------------------------------------
   10. DASHBOARD WIDGETS
   ----------------------------------------- */
.welcome-banner {
    background: linear-gradient(135deg, var(--color-liberty-blue) 0%, var(--blue-700) 100%);
    color: var(--color-white);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-8);
}

.welcome-banner-title {
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
}

.welcome-banner-text {
    font-size: var(--text-lg);
    opacity: 0.9;
    margin-bottom: var(--space-4);
}

.welcome-banner-meta {
    display: flex;
    gap: var(--space-6);
    font-size: var(--text-sm);
    opacity: 0.8;
}

.welcome-banner-cta {
    margin-top: var(--space-6);
}

.welcome-banner-cta .btn-primary {
    background: var(--color-patriot-red);
    border-color: var(--color-patriot-red);
}

/* Activity feed */
.activity-feed {
    list-style: none;
}

.activity-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--blue-50);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--color-liberty-blue);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-charcoal);
    margin-bottom: var(--space-1);
}

.activity-date {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

/* -----------------------------------------
   11. PROFILE SECTIONS
   ----------------------------------------- */
.profile-section {
    margin-bottom: var(--space-8);
}

.profile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.profile-section-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-charcoal);
}

.profile-section-edit {
    font-size: var(--text-sm);
    color: var(--color-liberty-blue);
    font-weight: var(--font-medium);
}

.profile-section-edit:hover {
    text-decoration: underline;
}

/* Address display */
.address-display {
    background: var(--gray-50);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    line-height: 1.6;
}

.address-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-bottom: var(--space-2);
}

/* Same as mailing checkbox section */
.same-as-mailing {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--blue-50);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

/* -----------------------------------------
   12. MEMBERSHIP STATUS
   ----------------------------------------- */
.membership-card {
    background: linear-gradient(135deg, var(--color-liberty-blue) 0%, #001d4a 100%);
    color: var(--color-white);
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.membership-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='90' fill='%23ffffff10'%3E⭐%3C/text%3E%3C/svg%3E") no-repeat;
    background-size: contain;
    opacity: 0.1;
}

.membership-type {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    opacity: 0.8;
    margin-bottom: var(--space-1);
}

.membership-name {
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
}

.membership-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.membership-meta-item {
    font-size: var(--text-sm);
}

.membership-meta-label {
    opacity: 0.7;
    display: block;
    margin-bottom: var(--space-1);
}

.membership-meta-value {
    font-weight: var(--font-semibold);
}

/* Auto-renewal toggle */
.renewal-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-top: var(--space-4);
}

.renewal-toggle-label {
    font-weight: var(--font-medium);
}

.renewal-toggle-status {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: var(--duration-200) var(--ease-in-out);
    border-radius: var(--radius-full);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: var(--color-white);
    transition: var(--duration-200) var(--ease-in-out);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #22c55e;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:focus-visible + .toggle-slider {
    outline: var(--ring-width) solid var(--ring-color);
    outline-offset: var(--ring-offset-width);
}

/* Disabled toggle (required/non-configurable) */
.toggle-required-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.toggle-switch.toggle-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-switch.toggle-disabled .toggle-slider {
    cursor: not-allowed;
}

.toggle-required-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    text-align: center;
}

/* -----------------------------------------
   13. RESPONSIVE STYLES
   ----------------------------------------- */
@media (max-width: 1024px) {
    .member-sidebar {
        width: 240px;
    }

    .member-main {
        padding: var(--space-6) var(--space-4);
    }
}

@media (max-width: 640px) {
    .member-layout {
        flex-direction: column;
        padding-bottom: 80px; /* Space for fixed bottom nav */
    }

    /* Hide sidebar header and footer on mobile - nav goes to bottom */
    .member-sidebar-header,
    .member-sidebar-footer {
        display: none;
    }

    /* Hide support phone banner on mobile to save space */
    .support-phone-banner {
        display: none !important;
    }

    /* Fixed bottom tab bar */
    .member-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: auto;
        background: var(--color-white);
        border-right: none;
        border-top: 1px solid var(--gray-200);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
        z-index: 1000;
    }

    .member-sidebar-nav {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: var(--space-2) 0;
        gap: 0;
        overflow: visible;
    }

    .member-sidebar-nav a {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--space-1);
        padding: var(--space-2) var(--space-3);
        font-size: 10px;
        font-weight: var(--font-medium);
        color: var(--gray-600);
        border-left: none;
        border-bottom: none;
        min-width: 64px;
        text-align: center;
    }

    .member-sidebar-nav a svg {
        width: 24px;
        height: 24px;
    }

    .member-sidebar-nav a.active {
        color: var(--color-liberty-blue);
        background: var(--blue-50);
        border-radius: var(--radius-md);
        border-left-color: transparent;
        border-bottom-color: transparent;
    }

    .member-sidebar-nav a:hover {
        background: var(--gray-50);
        border-radius: var(--radius-md);
    }

    /* Hide text label, show only icons + short label */
    .member-sidebar-nav a .nav-label {
        display: block;
        font-size: 10px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .member-main {
        padding: var(--space-4);
    }

    .page-title {
        font-size: var(--text-2xl);
    }

    .welcome-banner {
        padding: var(--space-5);
    }

    .welcome-banner-meta {
        flex-direction: column;
        gap: var(--space-2);
    }

    .stat-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .membership-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-card {
        border-radius: 0;
        box-shadow: none;
    }

    .auth-card-header,
    .auth-card-body {
        padding-left: var(--space-5);
        padding-right: var(--space-5);
    }

    .stat-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------
   14. STAT CARDS GRID
   ----------------------------------------- */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

/* -----------------------------------------
   15. DIVIDER
   ----------------------------------------- */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--space-6) 0;
    color: var(--gray-400);
    font-size: var(--text-sm);
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.divider span {
    padding: 0 var(--space-4);
}

/* -----------------------------------------
   16. LOADING STATE
   ----------------------------------------- */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-primary.btn-loading::after {
    border-top-color: var(--color-white);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* -----------------------------------------
   17. TEXT SIZE CONTROLS (Senior UX)
   Based on UX_Design_for_Seniors.pdf
   ----------------------------------------- */
.text-size-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.text-size-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    margin-right: var(--space-2);
}

.text-size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--color-white);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--duration-150) var(--ease-in-out);
}

.text-size-btn:hover {
    border-color: var(--color-liberty-blue);
    color: var(--color-liberty-blue);
}

.text-size-btn:focus-visible {
    outline: var(--ring-width) solid var(--ring-color);
    outline-offset: var(--ring-offset-width);
}

.text-size-btn.active {
    background: var(--color-liberty-blue);
    border-color: var(--color-liberty-blue);
    color: var(--color-white);
}

/* Text size modifiers applied to body */
body.text-size-large {
    font-size: 18px;
}

body.text-size-large .page-title {
    font-size: calc(var(--text-3xl) * 1.15);
}

body.text-size-large .card-title,
body.text-size-large .profile-section-title {
    font-size: calc(var(--text-lg) * 1.15);
}

body.text-size-xlarge {
    font-size: 20px;
}

body.text-size-xlarge .page-title {
    font-size: calc(var(--text-3xl) * 1.3);
}

body.text-size-xlarge .card-title,
body.text-size-xlarge .profile-section-title {
    font-size: calc(var(--text-lg) * 1.3);
}

/* -----------------------------------------
   18. RENEWAL CTA CARD
   ONE-TOUCH renewal prominent CTA
   ----------------------------------------- */
.renewal-cta-card {
    background: var(--color-white);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--color-patriot-red);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    margin-bottom: var(--space-6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
}

/* Hide when auto-renewal is enabled */
.renewal-cta-card.hidden {
    display: none;
}

.renewal-cta-badge {
    display: inline-block;
    background: var(--color-patriot-red);
    color: var(--color-white);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-3);
}

.renewal-cta-title {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-charcoal);
    margin: 0 0 var(--space-2);
}

.renewal-cta-subtitle {
    font-size: var(--text-base);
    color: var(--gray-600);
    margin: 0 0 var(--space-5);
}

.renewal-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: var(--color-patriot-red);
    color: var(--color-white);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    padding: var(--space-4) var(--space-8);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-150) var(--ease-in-out);
    box-shadow: 0 4px 12px rgba(226, 29, 55, 0.3);
}

.renewal-cta-btn:hover {
    background: var(--red-700);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(226, 29, 55, 0.4);
}

.renewal-cta-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.renewal-cta-note {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin: var(--space-4) 0 0;
}

/* -----------------------------------------
   18b. MEMBERSHIP STATUS CARD
   Shows current membership status
   ----------------------------------------- */
.membership-status-card {
    background: var(--color-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.membership-status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: #dcfce7;
    color: #15803d;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
}

.membership-status-badge svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.membership-status-type {
    font-size: var(--text-sm);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-bottom: var(--space-1);
}

.membership-status-name {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-charcoal);
    margin-bottom: var(--space-4);
}

.membership-status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

.membership-status-item {
    text-align: center;
    padding: var(--space-3);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.membership-status-label {
    font-size: var(--text-sm);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-bottom: var(--space-1);
}

.membership-status-value {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-charcoal);
}

@media (max-width: 600px) {
    .membership-status-grid {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------
   18c. AUTO-RENEWAL CARD
   Toggle for auto-renewal setting
   ----------------------------------------- */
.auto-renewal-card {
    background: var(--color-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.auto-renewal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.auto-renewal-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-charcoal);
    margin: 0;
}

.auto-renewal-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
}

.auto-renewal-status svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.auto-renewal-status--on {
    background: #dcfce7;
    color: #15803d;
}

.auto-renewal-status--off {
    background: var(--gray-100);
    color: var(--gray-600);
}

.auto-renewal-description {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin: 0 0 var(--space-5);
    line-height: 1.6;
}

.auto-renewal-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.auto-renewal-toggle-label {
    font-weight: var(--font-medium);
    color: var(--color-charcoal);
}

.auto-renewal-next-date {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* -----------------------------------------
   18d. DIGITAL MEMBERSHIP CARD (FR-04)
   Inline scannable card with QR code
   ----------------------------------------- */
.digital-member-card {
    background: linear-gradient(145deg, var(--color-liberty-blue) 0%, #001d4a 100%);
    color: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-6);
}

.digital-member-card::before {
    content: "";
    position: absolute;
    top: -20%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.digital-member-card::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.digital-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    position: relative;
    z-index: 1;
}

.digital-card-logo {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}

.digital-card-type {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    background: rgba(255,255,255,0.15);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.digital-card-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-6);
    align-items: end;
}

.digital-card-info {
    flex: 1;
}

.digital-card-name {
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
    letter-spacing: 0.02em;
}

.digital-card-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.digital-card-detail {
    display: flex;
    flex-direction: column;
}

.digital-card-detail-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    opacity: 0.7;
    margin-bottom: var(--space-1);
}

.digital-card-detail-value {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.digital-card-qr {
    background: var(--color-white);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.digital-card-qr svg,
.digital-card-qr img {
    width: 100px;
    height: 100px;
    display: block;
}

.digital-card-qr-label {
    font-size: var(--text-xs);
    color: var(--gray-600);
    text-align: center;
}

.digital-card-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-5);
    position: relative;
    z-index: 1;
}

.digital-card-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-md);
    color: var(--color-white);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--duration-150) var(--ease-in-out);
}

.digital-card-btn:hover {
    background: rgba(255,255,255,0.25);
}

.digital-card-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@media (max-width: 600px) {
    .digital-card-body {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    .digital-card-qr {
        width: fit-content;
    }

    .digital-card-actions {
        flex-direction: column;
    }

    .digital-card-btn {
        justify-content: center;
    }
}

/* -----------------------------------------
   19. ASK A QUESTION WIDGET (FR-06)
   Direct query functionality for sidebar
   ----------------------------------------- */
.ask-question-widget {
    background: linear-gradient(135deg, var(--blue-50) 0%, var(--color-white) 100%);
    border: 1px solid var(--blue-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin: var(--space-4);
    margin-top: 0;
}

.ask-question-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-liberty-blue);
    margin-bottom: var(--space-3);
}

.ask-question-title svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.ask-question-select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    background: var(--color-white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-2) center;
    padding-right: var(--space-8);
}

.ask-question-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-liberty-blue);
    color: var(--color-white);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: background var(--duration-150) var(--ease-in-out);
}

.ask-question-btn:hover {
    background: var(--blue-700);
}

.ask-question-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* -----------------------------------------
   20. ENGAGEMENT & GAMIFICATION (FR-07)
   Badges, activity tracking, tier status
   ----------------------------------------- */
.engagement-section {
    background: var(--color-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-6);
}

.engagement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    background: linear-gradient(135deg, var(--gold-100) 0%, var(--color-white) 100%);
    border-bottom: 1px solid var(--gray-200);
}

.engagement-tier {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.engagement-tier-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-constitution-gold) 0%, #d4a84b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(196, 154, 108, 0.3);
}

.engagement-tier-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--color-white);
}

.engagement-tier-info {
    display: flex;
    flex-direction: column;
}

.engagement-tier-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--gray-500);
}

.engagement-tier-name {
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-charcoal);
}

.engagement-points {
    text-align: right;
}

.engagement-points-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-constitution-gold);
}

.engagement-points-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.engagement-badges {
    padding: var(--space-5) var(--space-6);
}

.engagement-badges-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: var(--space-4);
}

.badges-grid {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    min-width: 80px;
}

.badge-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.badge-icon.earned {
    background: linear-gradient(135deg, var(--color-liberty-blue) 0%, #001d4a 100%);
    box-shadow: 0 4px 12px rgba(0, 84, 155, 0.25);
}

.badge-icon.locked {
    background: var(--gray-200);
    opacity: 0.6;
}

.badge-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--color-white);
}

.badge-icon.locked svg {
    fill: var(--gray-400);
}

.badge-label {
    font-size: var(--text-sm);
    color: var(--gray-600);
    text-align: center;
    max-width: 80px;
}

.engagement-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--gray-200);
    border-top: 1px solid var(--gray-200);
}

.engagement-stat {
    background: var(--gray-50);
    padding: var(--space-4);
    text-align: center;
}

.engagement-stat-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-liberty-blue);
    margin-bottom: var(--space-1);
}

.engagement-stat-label {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

@media (max-width: 600px) {
    .engagement-header {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .engagement-tier {
        flex-direction: column;
    }

    .engagement-points {
        text-align: center;
    }

    .engagement-stats {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------
   21. ENHANCED VISUAL HIERARCHY
   Bold typography, refined spacing
   ----------------------------------------- */
.visual-emphasis {
    position: relative;
}

.visual-emphasis::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-patriot-red);
    border-radius: 2px;
}

.visual-emphasis {
    padding-left: var(--space-5);
}

/* Card hover micro-interaction */
.card-interactive {
    transition: transform var(--duration-200) var(--ease-out),
                box-shadow var(--duration-200) var(--ease-out);
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Enhanced button with subtle animation */
.btn-animated {
    position: relative;
    overflow: hidden;
}

.btn-animated::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-animated:hover::after {
    width: 300px;
    height: 300px;
}

/* Focus enhancement for accessibility */
.focus-ring:focus-visible {
    outline: 3px solid var(--color-liberty-blue);
    outline-offset: 3px;
}

/* Enhanced form field focus */
.form-input-enhanced:focus {
    border-color: var(--color-liberty-blue);
    box-shadow: 0 0 0 4px rgba(0, 84, 155, 0.15);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid var(--color-white);
    }

    .card {
        border-width: 2px;
    }

    .form-input,
    .form-select {
        border-width: 2px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* -----------------------------------------
   22. TOAST NOTIFICATIONS
   ----------------------------------------- */
.toast {
    position: fixed;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--color-charcoal);
    color: var(--color-white);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-300) var(--ease-out);
    z-index: var(--z-50);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast svg {
    width: 24px;
    height: 24px;
    fill: #22c55e;
    flex-shrink: 0;
}

/* Toast success variant - right-aligned green toast */
.toast-success {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    left: auto;
    transform: translateY(100px);
    background: #22c55e;
    color: var(--color-white);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    opacity: 0;
    transition: all var(--duration-300) var(--ease-out);
    z-index: 1000;
}

.toast-success.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* -----------------------------------------
   AVATAR SELECTOR
   ----------------------------------------- */
.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--color-white);
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

/* When showing initials, use dark background */
.avatar-preview.has-initials {
    background: var(--color-liberty-blue);
    border-color: var(--color-liberty-blue);
}

.avatar-preview .avatar-initials {
    color: var(--color-white);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-3);
    margin: var(--space-3) 0;
}

@media (max-width: 600px) {
    .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 400px) {
    .avatar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.avatar-option {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    border: 3px solid var(--gray-200);
    cursor: pointer;
    overflow: hidden;
    transition: all var(--duration-150) var(--ease-in-out);
    background: var(--color-white);
}

.avatar-option:hover {
    border-color: var(--gray-300);
    transform: scale(1.08);
}

.avatar-option.selected {
    border-color: var(--color-constitution-gold);
    box-shadow: 0 0 0 3px var(--color-constitution-gold), 0 0 0 6px rgba(196, 154, 108, 0.25);
    background: var(--color-white);
    transform: scale(1.08);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials-option {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--color-liberty-blue);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    flex-shrink: 0;
}

.avatar-option-label {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-2) 0;
}

.avatar-option-label input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-liberty-blue);
}

.avatar-attribution {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin: var(--space-2) 0 0 0;
}

.avatar-attribution a {
    color: var(--gray-500);
    text-decoration: underline;
}

.avatar-attribution a:hover {
    color: var(--color-liberty-blue);
}

/* Sidebar avatar image support */
.member-sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Avatar upload option */
.avatar-upload-option {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--gray-200);
}

.avatar-upload-option:hover .avatar-upload-overlay {
    opacity: 1;
}

/* Member avatar in sidebar header - support images */
.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-white);
    border: 2px solid var(--gray-200);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    flex-shrink: 0;
    overflow: hidden;
}

/* When showing initials, use dark background */
.member-avatar.has-initials {
    background: var(--color-liberty-blue);
    border-color: var(--color-liberty-blue);
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* -----------------------------------------
   23. UTILITY CLASSES
   Common patterns extracted from inline styles
   ----------------------------------------- */

/* Flex utilities */
.flex-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.flex-row-sm {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.flex-row-lg {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.flex-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Text utilities */
.text-meta {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.text-muted {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.text-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

/* Card utilities */
.card-inset {
    padding: var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.card-bordered {
    padding: var(--space-4);
    background: var(--color-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}

/* Spacing utilities */
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

/* Gap utilities */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Width utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* -----------------------------------------
   MEGA MENU FIX FOR MEMBER AREA
   Ensure solid white background in member context
   ----------------------------------------- */
.member-layout ~ .v2-nav-bar .mega-menu,
.member-layout .mega-menu,
.mega-menu {
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
}
