/* ==========================================================================
   Zevonix Donations — Frontend Styles
   ========================================================================== */

:root {
    --zd-navy: #003874;
    --zd-navy-dark: #002A58;
    --zd-gold: #B49759;
    --zd-orange: #E8612D;
    --zd-orange-hover: #D4541F;
    --zd-text: #003874;
    --zd-text-secondary: #516B84;
    --zd-text-muted: #8696A7;
    --zd-white: #FFFFFF;
    --zd-surface: #FAFBFE;
    --zd-border: rgba(10, 37, 64, 0.12);
    --zd-font: Arial, "Helvetica Neue", sans-serif;
    --zd-radius: 10px;
    --zd-radius-lg: 14px;
    --zd-shadow: 0 2px 12px rgba(0, 56, 116, 0.07);
    --zd-transition: 0.25s ease;
}

.zd-wrap {
    font-family: var(--zd-font);
    color: var(--zd-text);
    max-width: 640px;
    margin: 0 auto;
}

.zd-form-card {
    background: var(--zd-white);
    border: 1px solid var(--zd-border);
    border-radius: var(--zd-radius-lg);
    padding: 2rem;
    box-shadow: var(--zd-shadow);
}

/* Form Groups */
.zd-form-group {
    margin-bottom: 1.25rem;
}

.zd-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.zd-form-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--zd-text-muted);
    margin: 1.75rem 0 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--zd-border);
}

.zd-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--zd-text);
    margin-bottom: 0.4rem;
}

.zd-required { color: var(--zd-orange); }
.zd-optional { font-weight: 400; color: var(--zd-text-muted); font-size: 0.8rem; }

.zd-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--zd-border);
    border-radius: 8px;
    font-size: 0.925rem;
    font-family: var(--zd-font);
    color: var(--zd-text);
    transition: border-color var(--zd-transition);
    box-sizing: border-box;
}

.zd-input:focus {
    outline: none;
    border-color: var(--zd-navy);
    box-shadow: 0 0 0 3px rgba(0, 56, 116, 0.08);
}

.zd-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Amount Grid */
.zd-amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.zd-amount-btn {
    padding: 0.8rem 0.5rem;
    border: 2px solid var(--zd-border);
    border-radius: 10px;
    background: var(--zd-white);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--zd-navy);
    cursor: pointer;
    transition: all 0.15s ease;
}

.zd-amount-btn:hover {
    border-color: var(--zd-navy);
    background: rgba(0, 56, 116, 0.03);
}

.zd-amount-btn.active {
    border-color: var(--zd-navy);
    background: var(--zd-navy);
    color: var(--zd-white);
}

.zd-amount-custom {
    position: relative;
    grid-column: span 3;
}

.zd-amount-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 700;
    color: var(--zd-text-muted);
}

.zd-amount-custom .zd-input {
    padding-left: 28px;
    font-size: 1.05rem;
    font-weight: 600;
}

/* Recurring Toggle */
.zd-recurring-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.925rem;
    padding: 0.75rem 1rem;
    background: var(--zd-surface);
    border: 1px solid var(--zd-border);
    border-radius: 10px;
}

.zd-recurring-toggle input { display: none; }

.zd-toggle-switch {
    width: 40px;
    height: 22px;
    background: #ccc;
    border-radius: 11px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.zd-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.zd-recurring-toggle input:checked + .zd-toggle-switch {
    background: var(--zd-navy);
}

.zd-recurring-toggle input:checked + .zd-toggle-switch::after {
    transform: translateX(18px);
}

/* Checkbox */
.zd-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Fund label */
.zd-fund-label {
    font-size: 0.9rem;
    color: var(--zd-text-secondary);
    margin-bottom: 1.25rem;
}

/* Donate Button */
.zd-donate-btn {
    width: 100%;
    padding: 1rem;
    background: var(--zd-orange);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.zd-donate-btn:hover { background: var(--zd-orange-hover); }
.zd-donate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Secure note */
.zd-secure-note {
    text-align: center;
    font-size: 0.78rem;
    color: var(--zd-text-muted);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

/* Messages */
.zd-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.zd-message-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.zd-message-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.zd-message-info { background: var(--zd-surface); color: var(--zd-text-secondary); border: 1px solid var(--zd-border); }

/* Payment Result */
.zd-result-card {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--zd-white);
    border: 1px solid var(--zd-border);
    border-radius: var(--zd-radius-lg);
    box-shadow: var(--zd-shadow);
}

.zd-result-icon { margin-bottom: 1rem; }
.zd-result-success { color: #16a34a; }
.zd-result-cancelled { color: #dc2626; }

.zd-result-card h2 {
    margin: 0 0 0.5rem;
    color: var(--zd-navy);
}

.zd-result-card p {
    color: var(--zd-text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

/* Donation History */
.zd-history {
    background: var(--zd-white);
    border: 1px solid var(--zd-border);
    border-radius: var(--zd-radius-lg);
    padding: 1.5rem;
}

.zd-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.zd-history-header h3 { margin: 0; }

.zd-history-total {
    font-size: 0.9rem;
    color: var(--zd-text-secondary);
}

.zd-history-table-wrap { overflow-x: auto; }

.zd-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.zd-history-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--zd-border);
    font-weight: 600;
    color: var(--zd-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.zd-history-table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--zd-border);
}

/* Status badges */
.zd-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.zd-status-completed { background: #dcfce7; color: #166534; }
.zd-status-pending { background: #fef9c3; color: #854d0e; }
.zd-status-failed { background: #fef2f2; color: #991b1b; }
.zd-status-refunded { background: #f3f4f6; color: #4b5563; }
.zd-status-cancelled { background: #f3f4f6; color: #6b7280; }

.zd-badge-recurring {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(0, 56, 116, 0.08);
    color: var(--zd-navy);
}

/* Responsive */
@media (max-width: 600px) {
    .zd-form-card { padding: 1.25rem; }
    .zd-form-grid { grid-template-columns: 1fr; }
    .zd-amount-grid { grid-template-columns: repeat(2, 1fr); }
    .zd-amount-custom { grid-column: span 2; }
    .zd-history-header { flex-direction: column; gap: 0.5rem; }
}
