/* Foundation Membership — Public Styles */
*, *::before, *::after { box-sizing: border-box; }

.fm-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
    color: #1e293b;
    line-height: 1.6;
}

/* ---- Badges & Status ---- */
.fm-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
}
.fm-badge-gold          { background: #fef3c7; color: #92400e; }
.fm-badge-platinum      { background: #e0e7ff; color: #3730a3; }
.fm-badge-trustee       { background: #d1fae5; color: #065f46; }
.fm-badge-general       { background: #f0f9ff; color: #0369a1; }
.fm-badge-general-member{ background: #f0f9ff; color: #0369a1; }
.fm-badge-active        { background: #d1fae5; color: #065f46; }
.fm-badge-pending       { background: #fef3c7; color: #92400e; }
.fm-badge-expired       { background: #fee2e2; color: #991b1b; }
.fm-badge-warning       { background: #ffedd5; color: #9a3412; }
.fm-badge-members       { background: #ede9fe; color: #5b21b6; }

.fm-status-active  { color: #16a34a; font-weight: 600; }
.fm-status-pending { color: #d97706; font-weight: 600; }
.fm-status-expired { color: #dc2626; font-weight: 600; }

/* ---- Messages ---- */
.fm-messages { margin: 16px 0; }
.fm-success { background: #d1fae5; border: 1px solid #6ee7b7; border-radius: 8px; padding: 14px 18px; color: #065f46; }
.fm-error   { background: #fee2e2; border: 1px solid #fca5a5; border-radius: 8px; padding: 14px 18px; color: #991b1b; }
.fm-info    { color: #64748b; font-size: .85rem; }
.fm-field-error { color: #dc2626; font-size: .85rem; margin-top: 6px; }

/* ---- Forms ---- */
.fm-form label {
    display: block;
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: 14px;
    color: #374151;
}
.fm-form input[type="text"],
.fm-form input[type="email"],
.fm-form input[type="password"],
.fm-form input[type="url"],
.fm-form input[type="number"],
.fm-form textarea,
.fm-form select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: .95rem;
    margin-top: 4px;
    color: #1e293b;
    background: #fff;
    transition: border-color .15s;
}
.fm-form input:focus, .fm-form textarea:focus, .fm-form select:focus {
    outline: none; border-color: #6366f1;
}
.fm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:600px){ .fm-form-row { grid-template-columns: 1fr; } }

.fm-form-section { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid #f1f5f9; }
.fm-form-section:last-of-type { border-bottom: none; }
.fm-form-section h4 { margin: 0 0 14px; font-size: 1rem; color: #374151; }

.fm-checkbox-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .9rem; }
.fm-checkbox-label input { margin-top: 3px; width: auto; }

.fm-submit-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #6366f1;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.fm-submit-btn:hover { background: #4f46e5; }
.fm-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

.fm-total-row {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1.05rem;
    margin: 16px 0;
}

/* ---- Payment Tabs ---- */
.fm-payment-methods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.fm-payment-tab {
    padding: 8px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 500;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.fm-payment-tab.active { border-color: #6366f1; background: #eef2ff; color: #4338ca; }
.fm-payment-panel { margin-top: 12px; }
.fm-stripe-element {
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 14px;
}

/* ---- Membership Levels ---- */
.fm-join-header { text-align: center; margin-bottom: 36px; }
.fm-join-header h2 { font-size: 2rem; margin-bottom: 8px; }
.fm-join-tagline { color: #64748b; font-size: 1.05rem; }

.fm-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.fm-level-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    position: relative;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    cursor: pointer;
}
.fm-level-card:hover,
.fm-level-card.fm-selected { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); transform: translateY(-2px); }
.fm-level-sponsor { border-color: #f59e0b; }
.fm-level-sponsor:hover, .fm-level-sponsor.fm-selected { border-color: #d97706; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.fm-level-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #f59e0b; color: #fff; padding: 3px 14px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.fm-level-name { font-size: 1.15rem; font-weight: 700; margin: 8px 0; }
.fm-price-amount { font-size: 2rem; font-weight: 800; color: #6366f1; }
.fm-price-period { color: #94a3b8; font-size: .85rem; }
.fm-level-desc { color: #64748b; font-size: .85rem; margin: 10px 0; }
.fm-level-features { list-style: none; padding: 0; margin: 12px 0 20px; text-align: left; }
.fm-level-features li { padding: 4px 0; font-size: .88rem; color: #475569; }
.fm-level-features li::before { content: "✓  "; color: #16a34a; font-weight: 700; }
.fm-select-level { width: 100%; text-align: center; padding: 10px; background: #6366f1 !important; color: #fff !important; border-color: #6366f1 !important; border-radius: 8px; }
.fm-select-level:hover { background: #4f46e5 !important; }

.fm-selected-level-summary { background: #eef2ff; border-radius: 8px; padding: 14px 18px; margin-bottom: 20px; font-weight: 500; }

/* ---- Application Form ---- */
.fm-application-form { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 28px; margin-top: 8px; }
.fm-application-form h3 { margin: 0 0 20px; font-size: 1.3rem; }

/* ---- Dashboard ---- */
.fm-dashboard-header { margin-bottom: 28px; }
.fm-dashboard-header h2 { font-size: 1.8rem; margin-bottom: 4px; }
.fm-org-tagline { color: #64748b; }

.fm-dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
@media(max-width:700px){ .fm-dashboard-grid { grid-template-columns: 1fr; } }

.fm-membership-card, .fm-quick-actions {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px;
}
.fm-membership-card h3, .fm-quick-actions h3 { margin: 0 0 16px; font-size: 1.05rem; }
.fm-membership-level { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.fm-membership-dates { display: flex; flex-direction: column; gap: 10px; }
.fm-date-item { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.fm-date-label { font-size: .85rem; color: #64748b; }
.fm-date-value { font-weight: 600; }
.fm-date-expired { color: #dc2626; }
.fm-date-warning { color: #d97706; }
.fm-expired-notice { color: #dc2626; font-weight: 400; }
.fm-newsletter-status { color: #16a34a; margin-top: 12px; font-size: .9rem; }

.fm-action-list { list-style: none; padding: 0; margin: 0; }
.fm-action-link {
    display: block;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    font-size: .9rem;
    transition: background .12s;
}
.fm-action-link:hover { background: #eef2ff; color: #4338ca; }
.fm-action-donate { border-color: #fca5a5; }
.fm-action-events { border-color: #a5b4fc; }

/* Sponsor Profile */
.fm-sponsor-profile { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.fm-sponsor-profile h3 { margin: 0 0 16px; }
.fm-current-logo img { max-height: 80px; display: block; margin: 8px 0; }
.fm-logo-upload, .fm-org-info-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid #f1f5f9; }

/* Events in dashboard */
.fm-upcoming-events { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; }
.fm-upcoming-events h3 { margin: 0 0 16px; }
.fm-events-compact .fm-event-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.fm-events-compact .fm-event-item:last-child { border-bottom: none; }
.fm-event-date-badge { background: #6366f1; color: #fff; border-radius: 8px; padding: 6px 10px; text-align: center; min-width: 48px; }
.fm-event-month { display: block; font-size: .65rem; text-transform: uppercase; font-weight: 700; }
.fm-event-day   { display: block; font-size: 1.3rem; font-weight: 800; line-height: 1; }
.fm-event-details { flex: 1; }
.fm-event-details h4 { margin: 0 0 2px; font-size: .95rem; }
.fm-event-details h4 a { text-decoration: none; color: #1e293b; }
.fm-event-meta { color: #64748b; font-size: .82rem; margin: 0; }

/* ---- Events List ---- */
.fm-events-header { text-align: center; margin-bottom: 30px; }
.fm-events-header h2 { font-size: 2rem; }
.fm-events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.fm-event-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.fm-event-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.fm-event-sold-out { opacity: .7; }
.fm-event-image {
    height: 160px; background-size: cover; background-position: center; position: relative;
}
.fm-event-no-image { height: 48px; position: relative; }
.fm-members-badge { position: absolute; top: 10px; right: 10px; background: #5b21b6; color: #fff; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.fm-event-card-body { display: flex; gap: 14px; padding: 16px; }
.fm-event-date-block { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; text-align: center; min-width: 52px; align-self: flex-start; }
.fm-event-date-block .fm-event-month { font-size: .65rem; text-transform: uppercase; color: #6366f1; font-weight: 700; display: block; }
.fm-event-date-block .fm-event-day { font-size: 1.5rem; font-weight: 800; line-height: 1.1; display: block; }
.fm-event-info { flex: 1; }
.fm-event-title { margin: 0 0 6px; font-size: 1.05rem; }
.fm-event-title a { text-decoration: none; color: #1e293b; }
.fm-event-title a:hover { color: #6366f1; }
.fm-event-excerpt { color: #64748b; font-size: .85rem; margin: 6px 0; }
.fm-event-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fm-price-tag { font-size: .85rem; font-weight: 600; color: #059669; }
.fm-lock { font-size: .9rem; }
.fm-empty-state { text-align: center; padding: 48px 24px; color: #94a3b8; }

/* ---- Single Event ---- */
.fm-back-link { margin-bottom: 16px; }
.fm-back-link a { color: #6366f1; text-decoration: none; font-size: .9rem; }
.fm-event-hero { height: 280px; background-size: cover; background-position: center; border-radius: 12px; margin-bottom: 24px; }
.fm-event-single-content { display: grid; grid-template-columns: 1fr 320px; gap: 28px; }
@media(max-width:768px){ .fm-event-single-content { grid-template-columns: 1fr; } }
.fm-event-single-title { font-size: 1.8rem; margin: 12px 0 16px; }
.fm-event-single-meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #f1f5f9; }
.fm-meta-item { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: #475569; }
.fm-meta-icon { font-size: 1rem; }
.fm-event-description { line-height: 1.8; color: #374151; }

.fm-ticket-box { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; position: sticky; top: 24px; }
.fm-ticket-box h3 { margin: 0 0 12px; font-size: 1.1rem; }
.fm-ticket-price { font-size: 1.4rem; font-weight: 800; color: #059669; margin: 8px 0 16px; }
.fm-spots-left { font-size: .85rem; color: #64748b; }
.fm-few-left { color: #dc2626; font-weight: 600; }
.fm-ticket-confirmed { text-align: center; padding: 16px 0; }
.fm-check-icon { display: block; font-size: 3rem; color: #16a34a; margin-bottom: 8px; }

/* ---- Donation Form ---- */
.fm-donate-header { text-align: center; margin-bottom: 32px; }
.fm-donate-header h2 { font-size: 1.8rem; }
.fm-amount-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.fm-amount-btn {
    padding: 10px 20px; border: 2px solid #e2e8f0; border-radius: 8px; background: #fff;
    font-size: .95rem; font-weight: 600; cursor: pointer; transition: border-color .12s, background .12s;
}
.fm-amount-btn:hover, .fm-amount-btn.active { border-color: #6366f1; background: #eef2ff; color: #4338ca; }
.fm-custom-amount { margin-top: 8px; }

/* ---- Sponsors ---- */
.fm-sponsors-header { text-align: center; margin-bottom: 32px; }
.fm-sponsors-header h2 { font-size: 2rem; }
.fm-sponsor-level-section { margin-bottom: 40px; }
.fm-sponsor-level-title { font-size: 1.3rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 20px; }
.fm-sponsor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.fm-sponsor-grid-platinum { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.fm-sponsor-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; text-align: center; transition: transform .15s, box-shadow .15s; }
.fm-sponsor-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.fm-sponsor-link { display: block; }
.fm-sponsor-logo { max-width: 100%; max-height: 100px; object-fit: contain; margin-bottom: 10px; }
.fm-sponsor-name-only { font-size: 1.1rem; font-weight: 600; color: #334155; padding: 20px 0; }
.fm-sponsor-name { font-size: .85rem; color: #64748b; margin: 0; }
.fm-become-sponsor { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 32px; text-align: center; margin-top: 40px; }
.fm-become-sponsor h3 { margin: 0 0 10px; }

/* ---- Login/Not-member states ---- */
.fm-login-required, .fm-not-member { text-align: center; padding: 60px 24px; }

/* ---- Utility ---- */
.button.button-primary, .button-primary {
    background: #6366f1 !important; border-color: #4f46e5 !important; color: #fff !important;
}
.button.button-primary:hover { background: #4f46e5 !important; }
