/* ═══════════════════════════════════════════════════════════════
   DONATION SYSTEM — Premium Modal & Checkout Styles
   ═══════════════════════════════════════════════════════════════ */

/* ─── Modal Overlay ─────────────────────────────────── */
.donate-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    padding: 20px;
}

.donate-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ─── Modal Container ──────────────────────────────── */
.donate-modal {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.donate-modal-overlay.active .donate-modal {
    transform: translateY(0) scale(1);
}

/* Custom scrollbar */
.donate-modal::-webkit-scrollbar { width: 6px; }
.donate-modal::-webkit-scrollbar-track { background: transparent; }
.donate-modal::-webkit-scrollbar-thumb { background: #d4ddd1; border-radius: 3px; }

/* ─── Modal Header ─────────────────────────────────── */
.dm-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid #eef2ec;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 24px 24px 0 0;
    z-index: 2;
}

.dm-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dm-header-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3b5a38, #4a7046);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.dm-header-icon i { width: 22px; height: 22px; }

.dm-header-text h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.dm-header-text p {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.dm-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f5f6f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: all 0.2s;
}

.dm-close:hover {
    background: #e8ede6;
    color: #1a1a1a;
}

.dm-close i { width: 18px; height: 18px; }

/* ─── Modal Body ───────────────────────────────────── */
.dm-body {
    padding: 28px 32px 32px;
}

/* ─── Step Indicator ───────────────────────────────── */
.dm-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
    padding: 0 8px;
}

.dm-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #bbb;
    white-space: nowrap;
    transition: color 0.3s;
}

.dm-step.active { color: #3b5a38; }
.dm-step.completed { color: #7cb07a; }

.dm-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: #eef2ec;
    color: #999;
    transition: all 0.3s;
    flex-shrink: 0;
}

.dm-step.active .dm-step-num {
    background: #3b5a38;
    color: #fff;
}

.dm-step.completed .dm-step-num {
    background: #7cb07a;
    color: #fff;
}

.dm-step-line {
    flex: 1;
    height: 2px;
    background: #eef2ec;
    margin: 0 8px;
    border-radius: 2px;
    min-width: 20px;
}

.dm-step-line.completed { background: #7cb07a; }

/* ─── Panels (Screens) ─────────────────────────────── */
.dm-panel {
    display: none;
    animation: dmFadeIn 0.35s ease;
}

.dm-panel.active { display: block; }

@keyframes dmFadeIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ─── Section Label ────────────────────────────────── */
.dm-label {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dm-label i { width: 16px; height: 16px; color: #3b5a38; }

/* ─── Amount Selection ─────────────────────────────── */
.dm-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.dm-amount-btn {
    padding: 14px 8px;
    border: 2px solid #e8ede6;
    border-radius: 14px;
    background: #fff;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: 'Pretendard', sans-serif;
}

.dm-amount-btn:hover {
    border-color: #3b5a38;
    background: #f6f9f5;
}

.dm-amount-btn.active {
    border-color: #3b5a38;
    background: #3b5a38;
    color: #fff;
}

/* Custom amount input */
.dm-custom-amount {
    position: relative;
    margin-bottom: 20px;
}

.dm-custom-amount input {
    width: 100%;
    padding: 14px 16px 14px 32px;
    border: 2px solid #e8ede6;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Pretendard', sans-serif;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.2s;
    background: #fafbf9;
}

.dm-custom-amount input:focus { border-color: #3b5a38; }

.dm-custom-amount .currency-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 700;
    color: #999;
}

/* ─── Frequency Pills ──────────────────────────────── */
.dm-freq-row {
    display: flex;
    background: #f5f6f1;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.dm-freq-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Pretendard', sans-serif;
}

.dm-freq-btn.active {
    background: #fff;
    color: #3b5a38;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ─── Payment Method Cards ─────────────────────────── */
.dm-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.dm-method-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 2px solid #e8ede6;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.dm-method-card:hover {
    border-color: #c3debb;
    background: #fafdf9;
}

.dm-method-card.active {
    border-color: #3b5a38;
    background: #f6f9f5;
}

.dm-method-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.dm-method-card.active .dm-method-radio {
    border-color: #3b5a38;
}

.dm-method-radio-inner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s;
}

.dm-method-card.active .dm-method-radio-inner {
    background: #3b5a38;
}

.dm-method-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dm-method-icon i { width: 20px; height: 20px; }

.dm-method-info { flex: 1; }

.dm-method-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.dm-method-info span {
    font-size: 12px;
    color: #999;
}

.dm-method-brands {
    display: flex;
    gap: 6px;
    align-items: center;
}

.dm-brand-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: #f0f4ef;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Card Form ────────────────────────────────────── */
.dm-form-group {
    margin-bottom: 16px;
}

.dm-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.dm-input {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e8ede6;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Pretendard', sans-serif;
    color: #1a1a1a;
    outline: none;
    background: #fff;
    transition: border-color 0.2s;
}

.dm-input:focus { border-color: #3b5a38; }

.dm-input.error { border-color: #e74c3c; }

.dm-error-msg {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 4px;
    display: none;
}

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

/* ─── Donor Info Form ──────────────────────────────── */
.dm-donor-info {
    padding: 20px;
    background: #f8faf7;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid #e8ede6;
}

.dm-donor-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dm-donor-info h4 i { width: 16px; height: 16px; color: #3b5a38; }

/* ─── Checkbox ─────────────────────────────────────── */
.dm-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    cursor: pointer;
}

.dm-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b5a38;
    margin-top: 2px;
    flex-shrink: 0;
}

.dm-checkbox-row label {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    cursor: pointer;
}

/* ─── Bank Transfer Details ────────────────────────── */
.dm-bank-details {
    background: #f0f7ee;
    border: 1px dashed #c3debb;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}

.dm-bank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.dm-bank-row:last-child { border-bottom: none; }

.dm-bank-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.dm-bank-value {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dm-copy-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #3b5a38;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dm-copy-btn:hover { background: #2a4128; }
.dm-copy-btn i { width: 14px; height: 14px; }

/* ─── Bitcoin / Crypto Panel ───────────────────────── */
.dm-crypto-panel {
    text-align: center;
    margin-bottom: 20px;
}

.dm-crypto-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.dm-crypto-tab {
    padding: 8px 16px;
    border-radius: 10px;
    border: 2px solid #e8ede6;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Pretendard', sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dm-crypto-tab:hover { border-color: #c3debb; }

.dm-crypto-tab.active {
    border-color: #F7931A;
    background: #FFF8EF;
    color: #F7931A;
}

.dm-crypto-tab i { width: 14px; height: 14px; }

.dm-qr-container {
    background: #fff;
    border: 2px solid #eef2ec;
    border-radius: 16px;
    padding: 24px;
    display: inline-block;
    margin-bottom: 16px;
}

.dm-qr-code {
    width: 200px;
    height: 200px;
    background: #f5f6f1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* QR code rendered via canvas — this is the placeholder pattern */
.dm-qr-code canvas {
    width: 100% !important;
    height: 100% !important;
}

.dm-wallet-addr {
    background: #f5f6f1;
    border: 1px solid #e8ede6;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.dm-wallet-addr code {
    font-size: 12px;
    color: #1a1a1a;
    font-weight: 600;
    word-break: break-all;
    text-align: left;
    line-height: 1.5;
}

.dm-wallet-network {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    margin-bottom: 8px;
}

.dm-crypto-warning {
    background: #FFF8EF;
    border: 1px solid #F7931A33;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 12px;
    color: #8B6914;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}

.dm-crypto-warning i { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* ─── Action Buttons ───────────────────────────────── */
.dm-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.dm-btn {
    flex: 1;
    padding: 15px 24px;
    border-radius: 14px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Pretendard', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dm-btn i { width: 16px; height: 16px; }

.dm-btn-back {
    background: #f5f6f1;
    color: #555;
    flex: 0 0 auto;
    padding: 15px 20px;
}

.dm-btn-back:hover { background: #e8ede6; }

.dm-btn-primary {
    background: linear-gradient(135deg, #3b5a38, #4a7046);
    color: #fff;
}

.dm-btn-primary:hover {
    background: linear-gradient(135deg, #2a4128, #3b5a38);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59,90,56,0.3);
}

.dm-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ─── Summary / Review ─────────────────────────────── */
.dm-summary {
    background: #f8faf7;
    border: 1px solid #e8ede6;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
}

.dm-summary-header {
    padding: 16px 20px;
    background: #3b5a38;
    color: #fff;
}

.dm-summary-header h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.dm-summary-body {
    padding: 16px 20px;
}

.dm-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eef2ec;
}

.dm-summary-row:last-child { border-bottom: none; }

.dm-summary-row .label {
    font-size: 14px;
    color: #777;
}

.dm-summary-row .value {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

.dm-summary-row.total {
    padding-top: 14px;
    margin-top: 4px;
    border-top: 2px solid #3b5a38;
    border-bottom: none;
}

.dm-summary-row.total .value {
    font-size: 20px;
    color: #3b5a38;
}

/* ─── Confirmation Screen ──────────────────────────── */
.dm-confirmation {
    text-align: center;
    padding: 20px 0;
}

.dm-confirm-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b5a38, #6da06b);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: dmPulse 0.6s ease;
}

.dm-confirm-icon i { width: 40px; height: 40px; color: #fff; }

@keyframes dmPulse {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.dm-confirmation h3 {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.dm-confirmation p {
    font-size: 14px;
    color: #777;
    margin-bottom: 24px;
    line-height: 1.6;
}

.dm-receipt-id {
    background: #f0f7ee;
    border: 1px dashed #c3debb;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 13px;
    color: #555;
    margin-bottom: 20px;
    display: inline-block;
}

.dm-receipt-id strong {
    color: #3b5a38;
    font-weight: 700;
}

/* ─── Divider ──────────────────────────────────────── */
.dm-divider {
    border: none;
    border-top: 1px solid #eef2ec;
    margin: 20px 0;
}

/* ─── Secure Badge ─────────────────────────────────── */
.dm-secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #999;
    margin-top: 16px;
}

.dm-secure-badge i { width: 14px; height: 14px; }

/* ─── Loading Spinner ──────────────────────────────── */
.dm-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dmSpin 0.7s linear infinite;
}

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

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .donate-modal {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        margin-top: auto;
    }

    .donate-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .dm-header { padding: 20px 20px 16px; border-radius: 20px 20px 0 0; }
    .dm-body { padding: 20px 20px 28px; }
    .dm-amounts { grid-template-columns: repeat(2, 1fr); }
    .dm-form-row { grid-template-columns: 1fr; }
    .dm-steps { gap: 0; padding: 0; }
    .dm-step span { display: none; }
    .dm-step.active span { display: inline; }
    .dm-step-line { min-width: 12px; }
    .dm-actions { flex-direction: column; }
    .dm-btn-back { flex: 1; }
    .dm-crypto-tabs { flex-wrap: wrap; }
    .dm-wallet-addr code { font-size: 11px; }
    .dm-qr-code { width: 160px; height: 160px; }
}

@media (max-width: 380px) {
    .dm-amount-btn { font-size: 13px; padding: 12px 6px; }
    .dm-header-text h3 { font-size: 16px; }
    .dm-qr-code { width: 140px; height: 140px; }
}
