/* =====================================================================
   Palette - tuned to match a cream / deep-navy / indigo site theme.
   Adjust these three variables if your exact brand hex codes differ;
   everything else in this file references them.
   ===================================================================== */
:root {
    --tfs-accent: #5b4fe8;   /* indigo accent - e.g. your primary CTA button */
    --tfs-dark: #211f54;     /* deep navy - e.g. your header "Account" button */
    --tfs-cream: #faf6ea;    /* soft cream background */
}

/* =====================================================================
   Defensive resets — these two rules exist specifically so the trigger
   button and modal render correctly no matter what CSS a theme's header
   template applies to its own buttons/divs (flex stretching, forced
   display rules, etc). Keep the !important here; it's load-bearing.
   ===================================================================== */
.tfs-modal-trigger,
.tfs-avatar-btn {
    all: revert;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    line-height: normal !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    cursor: pointer;
}
.tfs-modal-trigger svg,
.tfs-modal-trigger i,
.tfs-avatar-btn svg,
.tfs-avatar-btn i { font-size: 16px; line-height: 1; }

.tfs-overlay { display: none !important; }
.tfs-overlay.tfs-modal-open { display: flex !important; }

/* ---------- Shared ---------- */
.tfs-btn {
    display: inline-block;
    padding: 12px 22px;
    background: var(--tfs-dark);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity .15s, transform .1s;
}
.tfs-btn:hover { opacity: 0.9; color: #fff; }
.tfs-btn:active { transform: scale(0.98); }
.tfs-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.tfs-btn-outline { background: transparent; color: var(--tfs-dark); border: 1px solid var(--tfs-dark); }
.tfs-notice { padding: 10px 14px; background: var(--tfs-cream); border-radius: 10px; }
.tfs-required { color: #c0392b; }
.tfs-error { color: #c0392b; font-size: 13px; }
.tfs-form-error { color: #c0392b; font-size: 13px; min-height: 16px; margin: 10px 0; }

/* Proceed/submit buttons use the accent indigo to stand out from the dark trigger button */
.tfs-proceed-donate,
.tfs-register-form button[type="submit"],
.tfs-login-form button[type="submit"] {
    background: var(--tfs-accent);
    width: 100%;
}

/* ---------- Forms (compact 2-column grid) ---------- */
.tfs-form { max-width: 480px; }
.tfs-form h3 { margin: 0 0 14px; color: var(--tfs-dark); }
.tfs-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 14px;
}
.tfs-fields-grid .tfs-field:has(textarea),
.tfs-fields-grid .tfs-donating-as {
    grid-column: 1 / -1;
}
@media (max-width: 480px) {
    .tfs-fields-grid { grid-template-columns: 1fr; }
}
.tfs-field { margin: 7px 0; }
.tfs-field label { display: block; margin-bottom: 4px; font-size: 13px; color: #444; }
.tfs-field input,
.tfs-field select,
.tfs-field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
}
.tfs-field input:focus,
.tfs-field select:focus,
.tfs-field textarea:focus {
    outline: none;
    border-color: var(--tfs-accent);
    box-shadow: 0 0 0 3px rgba(91, 79, 232, 0.15);
}
.tfs-field textarea { min-height: 64px; }

/* ---------- Account widget (logged in: avatar + name) ---------- */
.tfs-account-widget { display: inline-flex; align-items: center; gap: 10px; position: relative; }
.tfs-avatar-circle {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: var(--tfs-dark); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 15px;
}
.tfs-account-name { font-size: 14px; font-weight: 500; }
.tfs-account-dropdown {
    display: none; position: absolute; top: 120%; right: 0;
    background: #fff; border: 1px solid #eee; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(33,31,84,.15); min-width: 190px; z-index: 99999;
    overflow: hidden;
}
.tfs-account-dropdown.tfs-open { display: block; }
.tfs-account-dropdown a {
    display: block; padding: 11px 16px; text-decoration: none; color: #222; font-size: 14px;
}
.tfs-account-dropdown a:hover { background: var(--tfs-cream); }
.tfs-account-logged-out { display: inline-flex; gap: 8px; }

/* ---------- Campaign card ---------- */
.tfs-campaign-card {
    border: 1px solid #eee; border-radius: 20px; overflow: hidden;
    max-width: 400px; box-shadow: 0 6px 20px rgba(33,31,84,.08);
    display: flex; flex-direction: column; background: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
}
.tfs-campaign-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(33,31,84,.14); }

.tfs-campaign-image-wrap {
    position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden;
    background: linear-gradient(135deg, var(--tfs-dark), var(--tfs-accent));
}
.tfs-campaign-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.tfs-campaign-image-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.85);
}

.tfs-campaign-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; width: 100%; box-sizing: border-box; }
.tfs-campaign-title { margin: 0 0 8px; font-size: 20px; color: var(--tfs-dark); }
.tfs-campaign-desc { font-size: 14px; color: #666; margin-bottom: 16px; line-height: 1.5; }
.tfs-progress-track { background: #eee; border-radius: 20px; height: 8px; overflow: hidden; width: 100%; }
.tfs-progress-fill { background: linear-gradient(90deg, var(--tfs-accent), var(--tfs-dark)); height: 100%; border-radius: 20px; transition: width .4s ease; }
.tfs-progress-stats { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin: 10px 0 4px; width: 100%; }
.tfs-progress-stats .tfs-raised { font-weight: 700; color: var(--tfs-dark); }
.tfs-progress-stats .tfs-goal { color: #888; }
.tfs-percent-badge {
    display: inline-block; background: var(--tfs-cream); color: var(--tfs-dark);
    font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-left: 8px;
}
.tfs-donor-count { font-size: 13px; color: #999; margin: 6px 0 16px; }
.tfs-campaign-card .tfs-modal-trigger { background: var(--tfs-accent); width: 100%; margin-top: auto; justify-content: center; }

/* =====================================================================
   Card style variants — selected via the "Card Style" dropdown in the
   Elementor widget (tfs-card-style-1 is the default set above).
   ===================================================================== */

/* ---------- 2. Minimal — outline button, flat bar ---------- */
.tfs-card-style-2 { box-shadow: none; border: 1px solid #e5e2d8; }
.tfs-card-style-2 .tfs-progress-track { border-radius: 6px; }
.tfs-card-style-2 .tfs-progress-fill { background: var(--tfs-dark); border-radius: 6px; }
.tfs-card-style-2 .tfs-modal-trigger { background: transparent; color: var(--tfs-dark); border: 1.5px solid var(--tfs-dark); }

/* ---------- 3. Big number — badge on photo ---------- */
.tfs-photo-badge {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    background: rgba(255,255,255,.95); color: var(--tfs-dark);
    font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
}
.tfs-card-style-3 .tfs-modal-trigger { background: var(--tfs-dark); }

/* ---------- 4, 5, 6: full-photo overlay with dim scrim ---------- */
.tfs-card-style-4, .tfs-card-style-5, .tfs-card-style-6 { position: relative; height: 380px; }
.tfs-card-style-4 .tfs-campaign-image-wrap,
.tfs-card-style-5 .tfs-campaign-image-wrap,
.tfs-card-style-6 .tfs-campaign-image-wrap { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.tfs-campaign-scrim { position: absolute; inset: 0; z-index: 1; }
.tfs-card-style-4 .tfs-campaign-scrim,
.tfs-card-style-6 .tfs-campaign-scrim { background: linear-gradient(to top, rgba(20,18,50,.92) 15%, rgba(20,18,50,.05) 65%); }
.tfs-card-style-5 .tfs-campaign-scrim { background: rgba(20,18,50,.6); }
.tfs-card-style-4 .tfs-campaign-body,
.tfs-card-style-5 .tfs-campaign-body,
.tfs-card-style-6 .tfs-campaign-body {
    position: relative; z-index: 2; height: 100%; justify-content: flex-end;
}
.tfs-card-style-4 .tfs-campaign-title,
.tfs-card-style-5 .tfs-campaign-title,
.tfs-card-style-6 .tfs-campaign-title { color: #fff; }
.tfs-card-style-4 .tfs-campaign-desc,
.tfs-card-style-5 .tfs-campaign-desc,
.tfs-card-style-6 .tfs-campaign-desc { color: rgba(255,255,255,.85); }
.tfs-card-style-4 .tfs-progress-track,
.tfs-card-style-5 .tfs-progress-track,
.tfs-card-style-6 .tfs-progress-track { background: rgba(255,255,255,.25); }
.tfs-card-style-4 .tfs-progress-stats span,
.tfs-card-style-5 .tfs-progress-stats span,
.tfs-card-style-6 .tfs-progress-stats span { color: rgba(255,255,255,.85); }
.tfs-card-style-4 .tfs-raised,
.tfs-card-style-5 .tfs-raised,
.tfs-card-style-6 .tfs-raised { color: #fff !important; }
.tfs-card-style-4 .tfs-modal-trigger,
.tfs-card-style-5 .tfs-modal-trigger,
.tfs-card-style-6 .tfs-modal-trigger { background: #fff; color: var(--tfs-dark); }

.tfs-card-style-5 .tfs-campaign-body { justify-content: center; align-items: center; text-align: center; }
.tfs-card-style-5 .tfs-modal-trigger { width: auto; padding: 12px 30px; }
.tfs-card-style-5 .tfs-progress-stats { justify-content: center; gap: 20px; }

.tfs-card-style-6 .tfs-photo-badge { background: var(--tfs-accent); color: #fff; }

/* ---------- 7. Split — image left, content right ---------- */
.tfs-card-style-7 { flex-direction: row; max-width: 640px; }
.tfs-card-style-7 .tfs-campaign-image-wrap { width: 40%; aspect-ratio: auto; flex-shrink: 0; }
.tfs-card-style-7 .tfs-campaign-body { flex: 1; }
@media (max-width: 520px) {
    .tfs-card-style-7 { flex-direction: column; max-width: 400px; }
    .tfs-card-style-7 .tfs-campaign-image-wrap { width: 100%; aspect-ratio: 16 / 10; }
}

/* ---------- 8. Progress ring badge (instead of linear bar) ---------- */
.tfs-card-style-8 { overflow: visible; }
.tfs-card-style-8 .tfs-campaign-image-wrap { border-radius: 20px 20px 0 0; overflow: hidden; }
.tfs-progress-ring {
    position: absolute; bottom: -24px; left: 18px; z-index: 2;
    width: 56px; height: 56px; background: #fff; border-radius: 50%;
    box-shadow: 0 4px 14px rgba(33,31,84,.2);
    display: flex; align-items: center; justify-content: center;
}
.tfs-progress-ring svg { position: absolute; }
.tfs-progress-ring span { position: relative; font-size: 11px; font-weight: 700; color: var(--tfs-dark); }
.tfs-card-style-8 .tfs-campaign-body { padding-top: 36px; }
.tfs-card-style-8 .tfs-modal-trigger { background: var(--tfs-dark); }

/* ---------- 9. Boxed — inset image, quiet border ---------- */
.tfs-card-style-9 { box-shadow: none; border: 1px solid #e5e2d8; padding: 14px; }
.tfs-card-style-9 .tfs-campaign-image-wrap { border-radius: 12px; }
.tfs-card-style-9 .tfs-campaign-body { padding: 14px 4px 4px; }
.tfs-card-style-9 .tfs-modal-trigger { background: transparent; color: var(--tfs-dark); border: 1.5px solid var(--tfs-dark); }
.tfs-card-style-9:hover { transform: none; box-shadow: none; }

/* ---------- 10. Dark card — navy background ---------- */
.tfs-card-style-10 { background: var(--tfs-dark); padding: 14px; }
.tfs-card-style-10 .tfs-campaign-image-wrap { border-radius: 12px; }
.tfs-card-style-10 .tfs-campaign-body { padding: 16px 6px 4px; }
.tfs-card-style-10 .tfs-campaign-title { color: #fff; }
.tfs-card-style-10 .tfs-campaign-desc { color: rgba(255,255,255,.7); }
.tfs-card-style-10 .tfs-progress-track { background: rgba(255,255,255,.15); }
.tfs-card-style-10 .tfs-progress-fill { background: var(--tfs-accent); }
.tfs-card-style-10 .tfs-progress-stats span { color: rgba(255,255,255,.7); }
.tfs-card-style-10 .tfs-raised { color: #fff !important; }
.tfs-card-style-10 .tfs-donor-count { color: rgba(255,255,255,.6); }

/* ---------- Modal shell (donation + account) ---------- */
.tfs-overlay {
    position: fixed; inset: 0; background: rgba(33,31,84,.55);
    align-items: center; justify-content: center;
    z-index: 999999; padding: 16px;
}
.tfs-modal {
    background: #fff; border-radius: 20px; padding: 30px;
    max-width: 460px; width: 100%; position: relative; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 70px rgba(33,31,84,.3);
}
.tfs-account-modal { max-width: 480px; }
.tfs-close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none; font-size: 26px; cursor: pointer; color: #999;
    line-height: 1; padding: 4px;
}
.tfs-close:hover { color: var(--tfs-dark); }
.tfs-amount-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.tfs-amount-chip {
    padding: 8px 16px; border: 1px solid #ddd; border-radius: 999px;
    background: #fff; cursor: pointer; font-size: 14px; font-weight: 500;
    transition: all .15s;
}
.tfs-amount-chip:hover { border-color: var(--tfs-accent); color: var(--tfs-accent); }
.tfs-success-details p { font-size: 14px; margin: 4px 0; }
.tfs-donating-as {
    font-size: 13px; background: var(--tfs-cream); padding: 10px 12px;
    border-radius: 10px; margin: 8px 0; color: #333;
}

/* ---------- Account modal: top-level Sign Up / Login tabs ---------- */
.tfs-toplevel-tabs {
    display: flex; gap: 4px; margin: 4px 0 20px; padding: 4px;
    background: var(--tfs-cream); border-radius: 999px;
}
.tfs-toplevel-tab-btn {
    flex: 1; padding: 10px; background: none; border: none; border-radius: 999px;
    cursor: pointer; font-size: 14px; font-weight: 600; color: #888;
    transition: background .15s, color .15s;
}
.tfs-toplevel-tab-btn.active { background: var(--tfs-dark); color: #fff; }

/* ---------- Account modal: Donor / Member sub-tabs ---------- */
.tfs-auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid #eee; }
.tfs-tab-btn {
    flex: 1; padding: 9px; background: none; border: none; cursor: pointer;
    font-size: 14px; font-weight: 600; color: #999; border-bottom: 2px solid transparent;
}
.tfs-tab-btn.active { color: var(--tfs-accent); border-bottom-color: var(--tfs-accent); }

/* ---------- Donation history ---------- */
.tfs-history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tfs-history-table th, .tfs-history-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eee; }
.tfs-history-table th { color: #888; font-weight: 600; }
