/* CQM Donate — Modal styles */
:root {
    --cqm-navy: #1e3a8a;
    --cqm-fuchsia: #e91e90;
    --cqm-white: #ffffff;
    --cqm-gray: #f1f5f9;
    --cqm-dark: #0f172a;
    --cqm-green: #22c55e;
    --cqm-radius: 16px;
    --cqm-font: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Overlay */
.cqm-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cqm-overlay[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Modal */
.cqm-modal {
    position: relative;
    width: 90vw;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--cqm-white);
    border-radius: var(--cqm-radius);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    padding: 32px;
    font-family: var(--cqm-font);
    color: var(--cqm-dark);
    transform: translateY(0) scale(1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cqm-overlay[aria-hidden="true"] .cqm-modal {
    transform: translateY(20px) scale(0.97);
}

/* Close button */
.cqm-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.cqm-modal__close:hover {
    background: var(--cqm-gray);
    color: var(--cqm-dark);
}

/* Header */
.cqm-modal__header {
    text-align: center;
    margin-bottom: 24px;
}

.cqm-modal__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--cqm-navy);
    margin: 0 0 4px;
}

.cqm-modal__subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Progress */
.cqm-modal__progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}

.cqm-progress-step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    transition: color 0.3s;
}

.cqm-progress-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--cqm-gray);
    font-size: 12px;
    font-weight: 700;
    transition: background 0.3s, color 0.3s;
}

.cqm-progress-step--active {
    color: var(--cqm-navy);
}

.cqm-progress-step--active span {
    background: var(--cqm-navy);
    color: var(--cqm-white);
}

.cqm-progress-step--done span {
    background: var(--cqm-green);
    color: var(--cqm-white);
}

/* Steps */
.cqm-step {
    display: none;
}

.cqm-step--active {
    display: block;
    animation: cqmFadeIn 0.3s ease;
}

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

/* Type toggle */
.cqm-type-toggle {
    display: flex;
    background: var(--cqm-gray);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}

.cqm-type-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-family: var(--cqm-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: #64748b;
    transition: all 0.25s ease;
}

.cqm-type-btn--active {
    background: var(--cqm-white);
    color: var(--cqm-navy);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Amount buttons */
.cqm-amounts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.cqm-amount-btn {
    padding: 14px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: var(--cqm-white);
    font-family: var(--cqm-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--cqm-navy);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cqm-amount-btn:hover {
    border-color: var(--cqm-fuchsia);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 30, 144, 0.15);
}

.cqm-amount-btn--selected {
    border-color: var(--cqm-fuchsia);
    background: linear-gradient(135deg, #fce4f3, #fdf2f8);
    color: var(--cqm-fuchsia);
    box-shadow: 0 4px 16px rgba(233, 30, 144, 0.2);
    transform: translateY(-2px);
}

/* Free amount */
.cqm-free-amount {
    margin-bottom: 16px;
}

.cqm-free-amount label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
}

.cqm-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.cqm-input-group:focus-within {
    border-color: var(--cqm-navy);
}

.cqm-input-group input {
    flex: 1;
    border: none;
    padding: 12px 14px;
    font-family: var(--cqm-font);
    font-size: 16px;
    outline: none;
    background: transparent;
}

.cqm-input-suffix {
    padding: 12px 14px;
    background: var(--cqm-gray);
    font-weight: 700;
    color: #64748b;
}

/* Deduction */
.cqm-deduction {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

.cqm-deduction__label {
    font-size: 13px;
    color: #15803d;
}

.cqm-deduction__value {
    font-size: 18px;
    font-weight: 700;
    color: #15803d;
}

/* Form fields */
.cqm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cqm-form-field {
    margin-bottom: 14px;
}

.cqm-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.cqm-form-field input[type="text"],
.cqm-form-field input[type="email"],
.cqm-form-field input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: var(--cqm-font);
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.cqm-form-field input:focus {
    outline: none;
    border-color: var(--cqm-navy);
}

/* Checkbox */
.cqm-checkbox-field label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    font-weight: 400;
    color: #475569;
    cursor: pointer;
}

.cqm-checkbox-field input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--cqm-navy);
}

/* Accordion */
.cqm-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}

.cqm-accordion summary {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--cqm-navy);
    cursor: pointer;
    background: var(--cqm-gray);
    list-style: none;
}

.cqm-accordion summary::-webkit-details-marker {
    display: none;
}

.cqm-accordion summary::before {
    content: '+ ';
    font-weight: 700;
}

.cqm-accordion[open] summary::before {
    content: '− ';
}

.cqm-accordion__content {
    padding: 16px;
}

/* Step actions */
.cqm-step-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Buttons */
.cqm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: var(--cqm-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.cqm-btn--primary {
    background: linear-gradient(135deg, var(--cqm-navy), #2563eb);
    color: var(--cqm-white);
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.3);
}

.cqm-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

.cqm-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cqm-btn--secondary {
    background: var(--cqm-gray);
    color: #475569;
    flex: 0 0 auto;
    width: auto;
}

.cqm-btn--secondary:hover {
    background: #e2e8f0;
}

/* Spinner */
.cqm-btn__spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--cqm-white);
    border-radius: 50%;
    animation: cqmSpin 0.6s linear infinite;
}

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

/* Card element */
.cqm-card-element {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.cqm-card-element.StripeElement--focus {
    border-color: var(--cqm-navy);
}

.cqm-card-element.StripeElement--invalid {
    border-color: #ef4444;
}

/* Error */
.cqm-error {
    color: #ef4444;
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 8px;
}

/* Payment summary */
.cqm-payment-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cqm-gray);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 15px;
}

.cqm-payment-summary strong {
    font-size: 20px;
    color: var(--cqm-navy);
}

.cqm-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: #e0e7ff;
    color: var(--cqm-navy);
    font-size: 12px;
    font-weight: 600;
}

/* Secure notice */
.cqm-secure-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    font-size: 12px;
    color: #64748b;
    margin-top: 16px;
}

.cqm-secure-notice svg {
    color: var(--cqm-green);
}

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

.cqm-confirmation__icon {
    margin-bottom: 16px;
}

.cqm-confirmation h3 {
    font-size: 22px;
    color: var(--cqm-navy);
    margin: 0 0 12px;
}

.cqm-confirmation p {
    color: #475569;
    font-size: 15px;
    margin: 0 0 8px;
}

.cqm-confirmation .cqm-btn {
    margin-top: 24px;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive */
@media (max-width: 480px) {
    .cqm-modal {
        padding: 24px 20px;
        border-radius: 12px;
        width: 95vw;
    }

    .cqm-amounts {
        grid-template-columns: repeat(2, 1fr);
    }

    .cqm-form-row {
        grid-template-columns: 1fr;
    }

    .cqm-modal__progress {
        gap: 4px;
        font-size: 12px;
    }
}
