/* =========================================================================
   Member Portal - shared design tokens
   ========================================================================= */
:root {
    --mp-primary: #1a5d3a;
    --mp-primary-dark: #144a2e;
    --mp-accent: #c6d62e;
    --mp-text: #1c1c1a;
    --mp-text-muted: #667085;
    --mp-line: #e4e7ec;
    --mp-bg-soft: #fafbfb;
}

.mp-form-wrap { max-width: 460px; margin: 0 auto; }

/* =========================================================================
   Login form
   ========================================================================= */
.mp-login-wrap { text-align: center; }
.mp-login-icon {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #eaf3ee;
    color: var(--mp-primary);
    display: flex; align-items: center; justify-content: center;
}
.mp-login-icon svg { width: 26px; height: 26px; }
.mp-login-heading { margin: 0 0 6px; font-size: 1.4rem; color: var(--mp-text); }
.mp-login-subtext { color: var(--mp-text-muted); font-size: 0.92rem; margin: 0 0 28px; }

#mp-login-form { text-align: left; }
#mp-login-form p { margin: 0 0 18px; }
#mp-login-form label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--mp-text); }
#mp-login-form input[type="text"],
#mp-login-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--mp-line);
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#mp-login-form input[type="text"]:focus,
#mp-login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 3px rgba(26,93,58,0.12);
}
.login-remember { display: flex; align-items: center; }
.login-remember label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.9rem; margin: 0; cursor: pointer; }
.login-remember input { margin: 0; }

#wp-submit {
    width: 100%;
    padding: 13px 22px;
    border: none;
    border-radius: 8px;
    background: var(--mp-primary);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
#wp-submit:hover { background: var(--mp-primary-dark); }
#wp-submit:active { transform: translateY(1px); }

.mp-form-footer { text-align: center; margin-top: 20px; font-size: 0.9rem; }
.mp-form-footer a { color: var(--mp-primary); font-weight: 500; }
.mp-form-footer a:hover { text-decoration: underline; }

/* =========================================================================
   Shared fields / buttons / alerts
   ========================================================================= */
.mp-field { margin-bottom: 18px; }
.mp-field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--mp-text); }
.mp-field input,
.mp-field select,
.mp-field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--mp-line);
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mp-field input:focus,
.mp-field select:focus,
.mp-field textarea:focus {
    outline: none;
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 3px rgba(26,93,58,0.12);
}
.mp-field input:disabled { background: #f2f4f5; color: var(--mp-text-muted); cursor: not-allowed; }

.mp-btn {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 14.5px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.mp-btn-primary { background: var(--mp-primary); color: #fff; }
.mp-btn-primary:hover { background: var(--mp-primary-dark); }
.mp-btn-secondary { background: #eef1f0; color: var(--mp-primary); }
.mp-btn-danger { background: #c0392b; color: #fff; }
.mp-btn-danger:hover { background: #a5301f; }
.mp-btn-secondary:hover { background: #e2e8e5; }
.mp-btn:active { transform: translateY(1px); }
.mp-btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

.mp-alert { padding: 13px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.92rem; }
.mp-alert-success { background: #e6f4ea; color: var(--mp-primary); border: 1px solid #b7dfc4; }
.mp-alert-error { background: #fdecec; color: #9c2b2b; border: 1px solid #f3c1c1; }

.mp-form-message { margin-top: 12px; font-size: 14px; }

/* =========================================================================
   Dashboard
   ========================================================================= */
.mp-dashboard { max-width: 720px; margin: 0 auto; }

.mp-dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; gap: 12px; flex-wrap: wrap; }

.mp-announcements { margin-bottom: 32px; display: flex; flex-direction: column; gap: 12px; }
.mp-announcement {
    display: flex;
    gap: 14px;
    background: #fffaf0;
    border: 1px solid #f0e0b8;
    border-left: 4px solid #c8901f;
    border-radius: 8px;
    padding: 16px 18px;
}
.mp-announcement-icon {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #c8901f;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.mp-announcement-icon svg { width: 16px; height: 16px; }
.mp-announcement-body { flex: 1; min-width: 0; }
.mp-announcement-body h4 { margin: 0 0 4px; font-size: 0.98rem; color: var(--mp-text); }
.mp-announcement-content { font-size: 0.9rem; color: var(--mp-text-muted); line-height: 1.55; }
.mp-announcement-content p { margin: 0 0 8px; }
.mp-announcement-content p:last-child { margin-bottom: 0; }
.mp-announcement-date { display: block; margin-top: 8px; font-size: 0.76rem; color: #98a2b3; }
.mp-dashboard-header h2 { margin: 0; font-size: 1.5rem; color: var(--mp-text); }
.mp-dashboard-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.mp-dashboard h3 {
    font-size: 1.05rem;
    color: var(--mp-text);
    margin: 0 0 14px;
    padding-left: 2px;
}

.mp-dashboard-subtext { font-size: 13px; color: var(--mp-text-muted); margin: 0 0 4px; }

.mp-dashboard-card {
    border: 1px solid var(--mp-line);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16,24,40,0.04);
}
.mp-dashboard-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid #f0f2f1; }
.mp-dashboard-row:last-of-type { border-bottom: none; }
.mp-dashboard-row span { color: var(--mp-text-muted); font-size: 0.92rem; }
.mp-dashboard-row strong { color: var(--mp-text); font-weight: 600; }


.mp-badge { padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.mp-badge-active { background: #e6f4ea; color: var(--mp-primary); }
.mp-badge-pending { background: #fff4e0; color: #9c6b0a; }
.mp-badge-expired,
.mp-badge-suspended { background: #fdecec; color: #9c2b2b; }
.mp-badge-type-membership { background: #e6f0fa; color: #1a4d8f; }
.mp-badge-type-event { background: #f0eafa; color: #5b2d91; }

.mp-field-note { font-size: 12px; color: #98a2b3; margin: 4px 0 0; }

.mp-profile-view-layout { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.mp-profile-view-details { flex: 1; min-width: 0; }

.mp-profile-photo {
    flex: 0 0 auto;
    width: 130px;
    height: 130px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--mp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(26,93,58,0.25);
}
.mp-profile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-profile-photo-placeholder { color: #fff; font-size: 3rem; font-weight: 700; font-family: inherit; }
.mp-profile-photo-small { width: 72px; height: 72px; border-radius: 12px; box-shadow: none; }
.mp-profile-photo-small .mp-profile-photo-placeholder { font-size: 1.8rem; }

.mp-photo-upload-row { display: flex; align-items: center; gap: 14px; }
.mp-photo-upload-row input[type="file"] { flex: 1; min-width: 0; }

.mp-profile-edit-form { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--mp-line); }

/* Payment History accordion */
.mp-accordion { border: 1px solid var(--mp-line); border-radius: 12px; background: #fff; overflow: hidden; box-shadow: 0 1px 3px rgba(16,24,40,0.04); }
.mp-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--mp-text);
    font-family: inherit;
    text-align: left;
}
.mp-accordion-toggle:hover { background: var(--mp-bg-soft); }
.mp-accordion-icon {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--mp-primary);
    color: var(--mp-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.25s ease, background 0.15s ease, color 0.15s ease;
}
.mp-accordion.is-open .mp-accordion-icon { transform: rotate(135deg); background: var(--mp-primary); color: #fff; }
.mp-accordion-body { display: none; padding: 0 24px 22px; }

.mp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mp-table { width: 100%; min-width: 480px; border-collapse: collapse; margin-top: 8px; }
.mp-table th {
    text-align: left; padding: 10px 12px; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--mp-text-muted); border-bottom: 2px solid var(--mp-line); white-space: nowrap;
}
.mp-table td { text-align: left; padding: 12px; border-bottom: 1px solid #f0f2f1; font-size: 14px; white-space: nowrap; }
.mp-table tr:last-child td { border-bottom: none; }

@media (max-width: 600px) {
    .mp-form-wrap,
    .mp-dashboard { padding-left: 4px; padding-right: 4px; box-sizing: border-box; }

    .mp-dashboard-header { flex-wrap: wrap; gap: 10px; }
    .mp-dashboard-header h2 { font-size: 1.2rem; word-break: break-word; }
    .mp-dashboard-header-actions { width: 100%; }
    .mp-dashboard-header-actions .mp-btn { flex: 1; text-align: center; }

    .mp-dashboard-row { flex-wrap: wrap; gap: 2px; }

    .mp-btn { width: 100%; text-align: center; box-sizing: border-box; }

    .mp-profile-view-layout { flex-direction: column; align-items: center; text-align: center; }
    .mp-profile-photo { width: 100px; height: 100px; }
    .mp-profile-photo-placeholder { font-size: 2.3rem; }
    .mp-profile-view-details .mp-dashboard-row { justify-content: center; flex-wrap: wrap; }

    .mp-accordion-toggle { padding: 16px 18px; font-size: 0.98rem; }
    .mp-accordion-body { padding: 0 18px 18px; }
}

/* =========================================================================
   Print - Payment History
   ========================================================================= */
.mp-print-only { display: none; }

.mp-payment-history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media print {
    /* Hide everything on the page by default... */
    body * { visibility: hidden; }

    /* ...then bring back only the payment history section, forced fully
       open regardless of whether the accordion was expanded or collapsed
       at the moment Print was clicked - a collapsed accordion has zero
       height, which would otherwise print a blank page. */
    .mp-payment-history-print,
    .mp-payment-history-print * { visibility: visible; }

    .mp-accordion-body { max-height: none !important; overflow: visible !important; }

    .mp-payment-history-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .mp-print-only { display: block; }
    .mp-print-header { margin-bottom: 20px; }
    .mp-print-header h2 { margin: 0 0 4px; font-size: 1.3rem; }
    .mp-print-header p { margin: 0; color: #444; font-size: 0.9rem; }

    .mp-no-print { display: none !important; }

    .mp-table th, .mp-table td { color: #000 !important; }
    .mp-badge { border: 1px solid #999; background: none !important; color: #000 !important; }
}

/* =========================================================================
   Membership application & existing-member forms
   ========================================================================= */
.mp-form-wrap.mp-app-wrap { max-width: 860px; }
.mp-app-wrap [hidden] { display: none !important; }
.mp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.mp-alert-info { background: #eef5f9; color: #1f4e63; border: 1px solid #cfe2ec; }
.mp-alert-info a { color: inherit; text-decoration: underline; }

.mp-section {
    border: 1px solid var(--mp-line);
    border-radius: 12px;
    padding: 22px 24px 8px;
    margin: 0 0 22px;
    background: #fff;
}
.mp-section legend {
    padding: 0 10px;
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--mp-primary);
}
.mp-section-intro { margin: 0 0 16px; color: var(--mp-text-muted); font-size: 0.9rem; }
.mp-field-note { margin: 6px 0 0; font-size: 0.82rem; color: var(--mp-text-muted); }
.mp-field-note.is-warning { color: #b32d2e; font-weight: 600; }

.mp-grid { display: grid; gap: 0 18px; }
.mp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 680px) {
    .mp-grid-2, .mp-grid-3 { grid-template-columns: 1fr; }
    .mp-section { padding: 18px 16px 6px; }
}

.mp-check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: 0.92rem; line-height: 1.45; cursor: pointer; }
.mp-check input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; }

.mp-supporter { margin-bottom: 8px; }
.mp-supporter h4 { margin: 0 0 10px; font-size: 0.95rem; color: var(--mp-text); }

.mp-btn-lg { padding: 14px 30px; font-size: 1rem; }
.mp-form-actions { margin: 4px 0 14px; }

.mp-form-message { display: none; margin-top: 14px; padding: 13px 16px; border-radius: 8px; font-size: 0.92rem; }
.mp-form-message.is-error { background: #fdecea; color: #8a1f17; border: 1px solid #f5c2bd; }
.mp-form-message.is-success { background: #e8f5ee; color: #14532d; border: 1px solid #bfe3cd; }

/* Document uploads */
.mp-upload {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    padding: 12px 0; border-top: 1px solid var(--mp-line);
}
.mp-upload:first-of-type { border-top: 0; }
.mp-upload-label { flex: 1 1 280px; font-size: 0.9rem; font-weight: 600; color: var(--mp-text); }
.mp-upload-req { color: #b32d2e; font-weight: 700; }
.mp-upload-control { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1 1 260px; }
.mp-upload-btn {
    position: relative; display: inline-block; padding: 8px 16px; border-radius: 8px;
    background: #eef1f0; color: var(--mp-primary); font-weight: 600; font-size: 0.86rem; cursor: pointer;
}
.mp-upload-btn:hover { background: #e2e8e5; }
.mp-upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.mp-upload-status { font-size: 0.84rem; color: var(--mp-text-muted); word-break: break-word; }
.mp-upload.is-done .mp-upload-status { color: #1a7f37; font-weight: 600; }
.mp-upload.is-error .mp-upload-status { color: #b32d2e; font-weight: 600; }
.mp-upload-remove { background: none; border: 0; color: #b32d2e; font-size: 0.82rem; cursor: pointer; text-decoration: underline; padding: 0; }

/* Payment method + bank transfer */
.mp-pay-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 560px) { .mp-pay-options { grid-template-columns: 1fr; } }
.mp-pay-option {
    display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px;
    border: 1.5px solid var(--mp-line); border-radius: 10px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s;
}
.mp-pay-option input { margin-top: 4px; }
.mp-pay-option strong { display: block; font-size: 0.95rem; color: var(--mp-text); }
.mp-pay-option small { display: block; font-size: 0.8rem; color: var(--mp-text-muted); margin-top: 2px; }
.mp-pay-option.is-selected { border-color: var(--mp-primary); background: #f3f9f5; }

.mp-bank-panel { border: 1px dashed #b7c9be; background: #fafdfb; border-radius: 10px; padding: 16px 18px 6px; margin-bottom: 18px; }
.mp-bank-amount { margin: 0 0 10px; font-size: 0.95rem; }
.mp-bank-details {
    background: #fff; border: 1px solid var(--mp-line); border-left: 4px solid var(--mp-primary);
    border-radius: 6px; padding: 12px 14px; margin-bottom: 12px; font-weight: 600; line-height: 1.6;
}
.mp-bank-extra { font-size: 0.88rem; color: var(--mp-text-muted); margin: 0 0 10px; }
.mp-bank-steps { margin: 0 0 16px 18px; padding: 0; font-size: 0.9rem; line-height: 1.6; }
.mp-wa-link { font-weight: 700; color: #128c4a; }

/* Payment history status */
.mp-pay-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: #eef1f0; color: var(--mp-text-muted); }
.mp-pay-status-paid { background: #e8f5ee; color: #14532d; }
.mp-pay-status-awaiting-verification, .mp-pay-status-pending { background: #fff4e0; color: #8a5a00; }
.mp-pay-status-failed, .mp-pay-status-declined { background: #fdecea; color: #8a1f17; }

/* Pop-ups (existing-member lookup result) */
.mp-modal { position: fixed; inset: 0; z-index: 100000; background: rgba(10, 20, 14, 0.6); display: flex; align-items: center; justify-content: center; padding: 20px; }
.mp-modal-box { background: #fff; border-radius: 14px; max-width: 460px; width: 100%; padding: 30px 28px 26px; box-shadow: 0 24px 60px rgba(0,0,0,0.3); }
.mp-modal-box h3 { margin: 0 0 12px; color: var(--mp-primary); font-size: 1.25rem; }
.mp-modal-box p { margin: 0 0 12px; line-height: 1.55; color: var(--mp-text); }
.mp-modal-box a { color: var(--mp-primary); font-weight: 600; }
.mp-modal-box .mp-btn { margin-top: 8px; }

/* Hidden parts of the payment chooser must stay hidden wherever it appears
   (it is used on membership forms and on event pages). */
.mp-pay-methods [hidden] { display: none !important; }
