/* ═══════════════════════════════════════════════════════
   TDF Donation Management — Public Frontend Styles
   ═══════════════════════════════════════════════════════ */

/* ── Donation Form ────────────────────────────────────── */
.tdf-donation-form-wrap {
    --tdf-color: #0d9488;
    --tdf-color-dark: color-mix(in srgb, var(--tdf-color) 80%, #000);
    --tdf-color-light: color-mix(in srgb, var(--tdf-color) 12%, #fff);
    --tdf-radius: 10px;
    --tdf-gray-50: #f9fafb;
    --tdf-gray-100: #f3f4f6;
    --tdf-gray-200: #e5e7eb;
    --tdf-gray-500: #6b7280;
    --tdf-gray-700: #374151;
    --tdf-gray-900: #111827;
    max-width: 520px;
    margin: 0 auto;
}

.tdf-donation-form {
    background: #fff;
    border-radius: var(--tdf-radius);
    padding: 24px;
    box-shadow: none;
    border: none;
}

.tdf-field-group {
    margin-bottom: 16px;
}

.tdf-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-weight: 600;
    color: var(--tdf-gray-700);
    margin-bottom: 6px;
    font-size: 0.875em;
}

.tdf-required {
    color: #dc2626;
}

/* ── Tooltips ─────────────────────────────────────────── */
.tdf-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    color: #0f172a;
    background: #e2e8f0;
    border-radius: 50%;
    padding: 2px;
}
.tdf-tooltip-wrap svg {
    width: 14px;
    height: 14px;
}
.tdf-tooltip-wrap:hover .tdf-tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.tdf-tooltip-text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: 250px;
    background: #1f2937;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: none;
}
.tdf-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.tdf-input, .tdf-select, .tdf-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--tdf-gray-200);
    border-radius: 4px !important;
    font-size: 0.9375em;
    color: var(--tdf-gray-900);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    font-family: inherit !important;
}
.tdf-input::placeholder, .tdf-textarea::placeholder {
    font-family: inherit !important;
    color: #9ca3af;
}
.tdf-input:focus, .tdf-select:focus, .tdf-textarea:focus {
    outline: none;
    border-color: var(--tdf-color);
    box-shadow: 0 0 0 3px var(--tdf-color-light);
}

/* ── Select Dropdown Arrow ────────────────────────────── */
.tdf-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 36px;
}

.tdf-input.tdf-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* ── Preset Amount Buttons ────────────────────────────── */
.tdf-preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tdf-preset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 2px solid var(--tdf-gray-200);
    border-radius: 4px !important;
    background: var(--tdf-gray-50);
    font-size: 0.9375em;
    font-weight: 600;
    color: var(--tdf-gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}
.tdf-preset-btn:hover {
    border-color: var(--tdf-color);
    color: var(--tdf-color);
    background: var(--tdf-color-light);
}
.tdf-preset-btn.active {
    background: var(--tdf-color);
    color: #fff;
    border-color: var(--tdf-color);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* ── Custom Amount Input ──────────────────────────────── */
.tdf-custom-amount {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--tdf-gray-200);
    border-radius: 4px !important;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tdf-custom-amount:focus-within {
    border-color: var(--tdf-color);
    box-shadow: 0 0 0 3px var(--tdf-color-light);
}
.tdf-currency-prefix {
    padding: 8px 12px;
    background: var(--tdf-gray-50);
    color: var(--tdf-gray-500);
    font-weight: 700;
    font-size: 1em;
    border-right: 1px solid var(--tdf-gray-200);
}
.tdf-amount-input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    align-items: center;
    flex: 1;
    font-size: 1em;
    font-weight: 600;
    background: transparent;
    font-family: inherit;
}
.tdf-amount-input:focus {
    outline: none;
    box-shadow: none !important;
}
.tdf-custom-amount.is-readonly {
    background: var(--tdf-gray-100);
    cursor: default;
}
.tdf-custom-amount.is-readonly .tdf-amount-input {
    pointer-events: none;
    cursor: default;
}
.tdf-custom-amount.is-readonly .tdf-currency-prefix {
    background: var(--tdf-gray-200);
}

/* ── Gateway Options ──────────────────────────────────── */
.tdf-gateway-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tdf-gateway-option {
    display: block;
    width: 100%;
    cursor: pointer;
}
.tdf-gateway-option input[type="radio"] {
    display: none;
}
.tdf-gateway-label {
    display: block;
    border: 1px solid var(--tdf-gray-200);
    border-radius: 4px !important;
    background: #fff;
    transition: all 0.2s ease;
    overflow: hidden;
}
.tdf-gateway-label:hover {
    border-color: var(--tdf-color);
}
.tdf-gateway-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #fff;
    transition: background 0.2s ease;
}
.tdf-gateway-title {
    font-weight: 500;
    font-size: 1em;
    color: var(--tdf-gray-700);
}
.tdf-gateway-desc {
    display: none;
    padding: 12px 16px;
    font-size: 0.85em;
    color: var(--tdf-gray-500);
    border-top: 1px solid var(--tdf-gray-200);
    background: var(--tdf-gray-50);
}
.tdf-gateway-option input:checked + .tdf-gateway-label {
    border-color: var(--tdf-color);
    box-shadow: 0 0 0 1px var(--tdf-color);
}
.tdf-gateway-option input:checked + .tdf-gateway-label .tdf-gateway-header {
    background: #fffcf5;
}
.tdf-gateway-option input:checked + .tdf-gateway-label .tdf-gateway-desc {
    display: block;
}
.tdf-gateway-icon {
    width: 80px;
    height: 36px;
    object-fit: contain;
}

/* ── Manual Gateway Instructions ──────────────────────── */
.tdf-manual-instructions {
    background: var(--tdf-gray-50);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 5px;
    font-size: 0.8125em;
    color: var(--tdf-gray-500);
    line-height: 1.6;
    white-space: pre-line;
    border: 1px solid var(--tdf-gray-200);
}

/* ── Submit Button ────────────────────────────────────── */
.tdf-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--tdf-color);
    color: #fff;
    border: none;
    border-radius: 4px !important;
    gap: 8px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.tdf-submit-btn:hover {
    background: var(--tdf-color-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}
.tdf-submit-btn:active {
    transform: translateY(0);
}
.tdf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tdf-spinner {
    width: 20px;
    height: 20px;
    animation: tdf-spin 1s linear infinite;
}
@keyframes tdf-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Consent text (Terms & Privacy) ───────────────────── */
.tdf-consent-text {
    margin: 10px 0 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: #6b7280;
    text-align: center;
}
.tdf-consent-text a {
    color: #059669;
    font-weight: 600;
    text-decoration: underline;
}
.tdf-consent-text a:hover {
    color: #047857;
}

/* ── Messages ─────────────────────────────────────────── */
.tdf-form-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}
.tdf-form-message.tdf-msg-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.tdf-form-message.tdf-msg-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Thank You Page ───────────────────────────────────── */
.tdf-thank-you {
    text-align: center;
    max-width: 500px;
    margin: 40px auto;
    font-family: system-ui, -apple-system, sans-serif;
}
.tdf-thank-you-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: #fff;
    font-size: 36px;
    line-height: 70px;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}
.tdf-thank-you h2 {
    color: #0d9488;
    font-size: 28px;
    margin-bottom: 8px;
}
.tdf-receipt-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin: 25px 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    text-align: left;
}
.tdf-receipt-table {
    width: 100%;
    border-collapse: collapse;
}
.tdf-receipt-table td {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}
.tdf-receipt-table tr:last-child td {
    border-bottom: none;
}
.tdf-receipt-label {
    color: #6b7280;
    font-weight: 500;
    width: 130px;
}
.tdf-receipt-amount {
    font-size: 22px;
    font-weight: 700;
    color: #0d9488;
}
.tdf-dua {
    color: #6b7280;
    font-style: italic;
    margin-top: 20px;
}

/* ── Status Badges (public) ───────────────────────────── */
.tdf-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.tdf-status-pending   { background: #fef3c7; color: #92400e; }
.tdf-status-completed { background: #d1fae5; color: #065f46; }
.tdf-status-failed    { background: #fee2e2; color: #991b1b; }

/* ── Campaign Progress Widget ─────────────────────────── */
.tdf-progress-widget {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    font-family: system-ui, sans-serif;
}
.tdf-progress-title {
    margin: 0 0 12px;
    font-size: 16px;
    color: #111827;
}
.tdf-progress-bar-wrap {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}
.tdf-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d9488, #14b8a6);
    border-radius: 6px;
    transition: width 1s ease;
    min-width: 2%;
}
.tdf-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}
.tdf-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 480px) {
    .tdf-donation-form {
        padding: 20px 16px;
    }
    .tdf-preset-buttons {
        gap: 6px;
    }
    .tdf-preset-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 70px;
    }
    .tdf-gateway-options {
        flex-direction: column;
    }
}

/* ═══════════════════════════════════════════════════════
   Modern Card Design (layout = "modern-card")
   ═══════════════════════════════════════════════════════ */
.tdf-form-card {
    --tdf-green: #064e3b;
    --tdf-green-dark: #022c22;
    --tdf-green-soft: #ecfdf5;
    --tdf-gold: #d97706;
    --tdf-gold-soft: #fffbeb;
    --tdf-gold-border: #f59e0b;
    --tdf-border: #e2e8f0;
    --tdf-input-bg: #f8fafc;
    --tdf-text-dark: #0f172a;
    --tdf-text-muted: #64748b;

    background: #ffffff;
    border: 1px solid var(--tdf-border);
    border-radius: 18px;
    padding: 28px 24px;
    max-width: 540px;
    margin: 0 auto;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    color: var(--tdf-text-dark);
}

.tdf-form-card *,
.tdf-form-card *::before,
.tdf-form-card *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: inherit !important;
}

/* Form Title */
.tdf-form-card .tdf-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--tdf-green);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 1. Sponsorship Cards */
.tdf-sponsor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.tdf-sponsor-card {
    border: 1.5px solid var(--tdf-border);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s ease;
    position: relative;
    text-align: left;
    display: block;
}

.tdf-sponsor-card:hover {
    border-color: var(--tdf-gold);
}

.tdf-sponsor-card.active {
    border-color: var(--tdf-gold-border);
    background: var(--tdf-gold-soft);
}

.tdf-badge-gold {
    position: absolute;
    top: -9px;
    right: 10px;
    background: var(--tdf-gold);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 20px;
}

.tdf-badge-green {
    position: absolute;
    top: -9px;
    right: 10px;
    background: var(--tdf-green);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 20px;
}

.tdf-card-lbl {
    font-size: 14px;
    color: var(--tdf-text-muted);
    font-weight: 500;
    margin-bottom: 4px;
    font-family: inherit !important;
}

.tdf-card-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--tdf-green);
    font-family: inherit !important;
}

.tdf-card-sub {
    font-size: 11.5px;
    color: var(--tdf-green);
    margin-top: 4px;
    font-weight: 600;
}

/* 2. Quick Amount Buttons (Pills) */
.tdf-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.tdf-quick-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.tdf-pill {
    padding: 8px 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit !important;
    color: var(--tdf-text-dark);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.tdf-pill:hover {
    background: #e2e8f0;
}

.tdf-pill.active {
    background: var(--tdf-green);
    color: #ffffff;
    border-color: var(--tdf-green);
}

/* 3. Form Input Controls */
.tdf-form-card .tdf-group {
    margin-bottom: 15px;
}

.tdf-form-card .tdf-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--tdf-text-dark);
    margin-bottom: 6px;
    font-family: inherit !important;
}

.tdf-form-card .tdf-label span {
    color: #dc2626;
}

.tdf-form-card .tdf-label span.tdf-phone-hint,
.tdf-form-card .tdf-label span.tdf-optional {
    color: #64748b !important;
    font-weight: 400 !important;
    font-size: 0.85em !important;
}

.tdf-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.tdf-input-cur {
    position: absolute;
    left: 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--tdf-green);
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

.tdf-form-card .tdf-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    font-family: inherit !important;
    border: 1px solid var(--tdf-border);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
    background: var(--tdf-input-bg);
    color: var(--tdf-text-dark);
    box-shadow: none;
}

.tdf-form-card .tdf-input:focus {
    background: #ffffff;
    border-color: var(--tdf-green);
    box-shadow: 0 0 0 3px rgba(6, 78, 59, 0.08);
}

.tdf-input-amount {
    padding-left: 38px !important;
    font-size: 17px;
    font-weight: 700;
    color: var(--tdf-text-dark);
}

.tdf-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 4. Payment Gateway Radios */
.tdf-gateways {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

/* Single enabled gateway → full width (no empty right column) */
.tdf-gateways-single {
    grid-template-columns: 1fr;
}

.tdf-gw-card {
    border: 1.5px solid var(--tdf-border);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s;
}

.tdf-gw-card:hover {
    border-color: #cbd5e1;
}

.tdf-gw-card.active {
    border-color: var(--tdf-green);
    background: var(--tdf-green-soft);
}

.tdf-gw-card input[type="radio"] {
    accent-color: var(--tdf-green);
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    /* Align radio with the vertical center of the logo row (logo max-height 34px) */
    margin-top: 9px;
}

.tdf-gw-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.tdf-gw-icon {
    max-width: 140px;
    max-height: 34px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
    display: block;
    margin: 0 0 3px;
    align-self: flex-start;
}

.tdf-gw-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--tdf-text-dark);
    line-height: 1.4;
}

.tdf-gw-sub {
    font-size: 13px;
    color: var(--tdf-text-muted);
    line-height: 1.55;
}

@media (max-width: 480px) {
    .tdf-gw-card {
        padding: 10px 12px;
    }
    .tdf-gw-icon {
        max-width: 115px;
        max-height: 28px;
    }
    .tdf-gw-name {
        font-size: 14px;
    }
    .tdf-gw-sub {
        font-size: 12.5px;
    }
}

/* 5. Submit Button */
.tdf-form-card .tdf-submit-btn {
    width: 100%;
    margin-top: 18px;
    padding: 13px 20px;
    background: var(--tdf-green);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(6, 78, 59, 0.2);
}

.tdf-form-card .tdf-submit-btn:hover {
    background: var(--tdf-green-dark);
    box-shadow: 0 6px 16px rgba(6, 78, 59, 0.3);
}

.tdf-form-card .tdf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 6. Security Reassurance */
.tdf-security {
    text-align: center;
    font-size: 12px;
    color: var(--tdf-text-muted);
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Manual gateway fields inside modern card */
.tdf-form-card .tdf-manual-fields {
    display: none;
}

/* Consent text inside modern card */
.tdf-form-card .tdf-consent-text {
    margin-top: 10px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .tdf-form-card {
        padding: 20px 16px;
    }
    .tdf-sponsor-grid {
        grid-template-columns: 1fr;
    }
    .tdf-row-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .tdf-quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tdf-gateways {
        grid-template-columns: 1fr;
    }
}

/* ── Dashboard Layout ─────────────────────────────────── */
.tdf-dashboard-wrapper {
    --tdf-color: #059669;
    --tdf-color-dark: #047857;
    --tdf-color-light: #ecfdf5;
    --dash-bg: #f1f5f9;
    --dash-border: #e2e8f0;
    --dash-text: #1e293b;
    --dash-muted: #64748b;
    font-family: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 0 40px;
}
.tdf-dashboard-wrapper *,
.tdf-dashboard-wrapper *::before,
.tdf-dashboard-wrapper *::after {
    font-family: inherit !important;
    box-sizing: border-box;
}

/* ── Donor OTP Login ───────────────────────────────────── */
.tdf-login-container {
    position: relative;
    width: min(100% - 28px, 440px);
    margin: 42px auto;
    padding: 22px 22px 18px;
    overflow: hidden;
    border: 1px solid #dbe4ec;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}
.tdf-login-container::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #064e3b, #059669, #10b981);
    content: '';
}
.tdf-login-heading,
.tdf-otp-heading {
    margin: 0 0 20px;
    text-align: center;
}
.tdf-login-heading h2,
.tdf-otp-heading h3 {
    margin: 0;
    color: #064e3b;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.35;
}
.tdf-login-heading p,
.tdf-otp-heading p {
    margin: 3px 0 0;
    color: #718096;
    font-size: 13px;
}
.tdf-login-step > .tdf-label,
.tdf-login-label-row .tdf-label {
    margin: 0 0 7px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 700;
}
.tdf-login-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.tdf-login-hint,
.tdf-login-help {
    color: #718096;
    font-size: 12px;
}
.tdf-login-container .tdf-input {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 11px 15px;
    border: 1px solid #dbe4ec;
    border-radius: 10px;
    background: #fff;
    color: #152238;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .04);
}
.tdf-login-container .tdf-input:focus {
    border-color: #059669;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, .12);
}
.tdf-login-help {
    margin: 5px 0 12px;
}
.tdf-login-message {
    margin: 0 0 8px;
    color: #b91c1c;
    font-size: 13px;
}
.tdf-login-submit {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 16px;
    border: 0;
    border-radius: 10px;
    background: #064e3b;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(6, 78, 59, .18);
    transition: background .15s ease, transform .15s ease;
}
.tdf-login-submit:hover { background: #033b2d; transform: translateY(-1px); }
.tdf-login-submit:disabled { opacity: .7; cursor: wait; transform: none; }
.tdf-login-btn-arrow { font-size: 20px; line-height: 1; }
.tdf-login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    color: #718096;
    font-size: 12px;
}
.tdf-login-footer > span { display: inline-flex; align-items: center; gap: 5px; }
.tdf-login-footer .dashicons { color: #059669; font-size: 15px; }
.tdf-login-footer a,
.tdf-otp-phone-notice button,
.tdf-otp-actions button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #047857;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}
.tdf-otp-phone-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #a7f3d0;
    border-radius: 9px;
    background: #ecfdf5;
    color: #475569;
    font-size: 12px;
}
.tdf-otp-phone-notice strong { color: #064e3b; }
.tdf-otp-digits {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
}
.tdf-login-container .tdf-otp-digit {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0;
    border: 1px solid #dbe4ec;
    border-radius: 9px;
    background: #fff;
    color: #064e3b;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .04);
}
.tdf-login-container .tdf-otp-digit:focus {
    border-color: #059669;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, .12);
}
.tdf-otp-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 14px 0;
    color: #64748b;
    font-size: 12px;
}
.tdf-otp-actions strong {
    padding: 3px 7px;
    border-radius: 5px;
    background: #ecfdf5;
    color: #047857;
    font-variant-numeric: tabular-nums;
}
.tdf-otp-actions button:disabled { color: #94a3b8; text-decoration: none; cursor: not-allowed; }

.tdf-dashboard-wrapper .tdf-login-container,
.tdf-dashboard-wrapper .tdf-login-container * {
    box-sizing: border-box;
}
.tdf-dashboard-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.tdf-dashboard-sidebar {
    width: 270px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--dash-border);
    overflow: hidden;
    flex-shrink: 0;
    position: sticky;
    top: 30px;
}
.tdf-sidebar-profile {
    padding: 28px 20px 24px;
    text-align: center;
    background: linear-gradient(135deg, var(--tdf-color) 0%, var(--tdf-color-dark) 100%);
    color: #fff;
    position: relative;
}
.tdf-sidebar-profile::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 24px;
    background: #fff;
    border-radius: 18px 18px 0 0;
}
.tdf-profile-avatar {
    width: 68px;
    height: 68px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    line-height: 68px;
    border-radius: 50%;
    margin: 0 auto 12px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
}
.tdf-profile-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
    position: relative;
    z-index: 1;
}
.tdf-profile-phone {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.85);
    direction: ltr;
    position: relative;
    z-index: 1;
}
.tdf-dashboard-nav {
    list-style: none;
    margin: 0;
    padding: 14px 12px;
}
.tdf-dashboard-nav li {
    margin: 0;
    padding: 0;
}
.tdf-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 14.5px;
    transition: all 0.2s;
    border-radius: 10px;
    border-left: none;
}
.tdf-nav-link svg {
    opacity: 0.75;
    flex-shrink: 0;
}
.tdf-nav-link:hover {
    background: #f8fafc;
    color: var(--tdf-color);
}
.tdf-nav-link.active {
    background: var(--tdf-color-light);
    color: var(--tdf-color);
}
.tdf-nav-link.active svg {
    opacity: 1;
}
.tdf-sidebar-footer {
    border-top: 1px solid var(--dash-border);
    padding: 12px;
}
.tdf-logout-link {
    color: #ef4444;
    margin-bottom: 0;
}
.tdf-logout-link:hover {
    background: #fef2f2;
    color: #dc2626;
}
.tdf-dashboard-main {
    flex-grow: 1;
    min-width: 0;
}
.tdf-dash-title {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 700;
    color: var(--dash-text);
}
.tdf-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.tdf-summary-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    border: 1px solid var(--dash-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tdf-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}
.tdf-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tdf-card-label {
    font-size: 12.5px;
    color: var(--dash-muted);
    margin-bottom: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tdf-card-value {
    font-size: 21px;
    font-weight: 700;
    color: var(--dash-text);
    line-height: 1.2;
}
.tdf-dash-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    border: 1px solid var(--dash-border);
}
.tdf-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tdf-history-responsive {
    overflow-x: visible;
}
.tdf-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.tdf-table th {
    background: #f8fafc;
    padding: 13px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    border-bottom: 1px solid var(--dash-border);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.tdf-table th:first-child { border-radius: 0; }
.tdf-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.tdf-table tr:last-child td {
    border-bottom: none;
}
.tdf-table tbody tr {
    transition: background 0.15s ease;
}
.tdf-table tbody tr:hover {
    background: #f8fafc;
}
.tdf-badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.tdf-badge-pending { background: #fef3c7; color: #b45309; }
.tdf-badge-completed { background: #dcfce7; color: #15803d; }
.tdf-badge-failed { background: #fee2e2; color: #b91c1c; }
.tdf-badge-active { background: #e0e7ff; color: #4338ca; }
.tdf-badge-cancelled { background: #f1f5f9; color: #64748b; }

/* Donation history: compact desktop table, no-horizontal-scroll mobile cards. */
.tdf-history-table {
    table-layout: fixed;
}
.tdf-history-table th,
.tdf-history-table td {
    padding: 11px 12px;
    overflow-wrap: anywhere;
}
.tdf-history-table th:nth-child(1) { width: 13%; }
.tdf-history-table th:nth-child(2) { width: 23%; }
.tdf-history-table th:nth-child(3) { width: 24%; }
.tdf-history-table th:nth-child(4) { width: 13%; }
.tdf-history-table th:nth-child(5) { width: 14%; }
.tdf-history-table th:nth-child(6) { width: 13%; }
.tdf-history-table th {
    white-space: normal;
}
.tdf-transaction-id {
    display: inline-block;
    max-width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
    vertical-align: middle;
}
.tdf-copy-transaction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 3px 0 0 4px;
    padding: 3px 7px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: #475569;
    font: inherit;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
}
.tdf-copy-transaction:hover,
.tdf-copy-transaction.is-copied {
    border-color: #059669;
    background: #ecfdf5;
    color: #047857;
}
.tdf-transaction-empty {
    color: #94a3b8;
}
.tdf-history-amount {
    font-weight: 700;
    white-space: nowrap;
}
.tdf-receipt-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    background: #ecfdf5;
    color: #059669;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.tdf-receipt-link:hover {
    background: #d1fae5;
    color: #047857;
}
.tdf-history-mobile-row {
    display: none;
}
.tdf-donation-history-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}
.tdf-history-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
}
.tdf-history-purpose {
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.tdf-history-card-amount {
    color: #064e3b;
    font-size: 18px;
    font-weight: 700;
}
.tdf-history-card-transaction {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 7px;
    border-top: 1px solid #f1f5f9;
}
.tdf-history-detail-label {
    width: 100%;
    color: #64748b;
    font-size: 11px;
}
.tdf-history-card-transaction code {
    max-width: calc(100% - 55px);
    padding: 0;
    background: transparent;
    color: #334155;
    font-size: 12px;
    overflow-wrap: anywhere;
}
.tdf-history-card .tdf-receipt-link {
    align-self: flex-start;
    margin-top: 2px;
}
.tdf-btn-cancel-sub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.tdf-btn-cancel-sub:hover {
    background: #fca5a5;
}
@keyframes tdfFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 900px) {
    .tdf-summary-cards {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .tdf-dashboard-layout {
        flex-direction: column;
        gap: 16px;
    }
    .tdf-dashboard-sidebar {
        width: 100%;
        position: static;
    }
    .tdf-sidebar-profile {
        padding: 22px 20px 20px;
    }
    .tdf-dashboard-nav {
        padding: 10px;
    }
    .tdf-nav-link {
        padding: 11px 14px;
    }
    .tdf-dash-title {
        font-size: 19px;
    }
    .tdf-dash-card {
        padding: 16px;
    }
    .tdf-history-card-container {
        padding: 0;
        overflow: visible !important;
        background: transparent;
        border: 0;
        box-shadow: none;
    }
    .tdf-history-responsive {
        overflow: visible;
    }
    .tdf-history-table,
    .tdf-history-table tbody,
    .tdf-history-table tr,
    .tdf-history-table td {
        display: block;
        width: 100%;
    }
    .tdf-history-table thead,
    .tdf-history-desktop-row {
        display: none !important;
    }
    .tdf-history-table tr.tdf-history-mobile-row {
        display: block;
        margin: 0 0 10px;
        border: 0;
    }
    .tdf-history-table .tdf-history-mobile-row td {
        display: block;
        width: 100%;
        padding: 0;
        border: 0;
    }
    .tdf-donation-history-card {
        padding: 13px;
    }
    .tdf-copy-transaction {
        min-height: 30px;
        padding: 5px 9px;
    }
}
