/* RHF Custom Donate Wizard — matches GiveWP form styling */

.rhf-donate-modal__dialog {
    width: min(100%, 520px);
    height: auto;
    max-height: min(92dvh, 720px);
    margin: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 0 1 auto;
}

.rhf-donate-modal {
    padding: var(--spacing-md);
    align-items: center;
    justify-content: center;
}

.rhf-donate-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.rhf-donate-wizard {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    color: var(--text-dark);
}

.rhf-donate-wizard__intro {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.rhf-donate-wizard__label {
    display: block;
    margin: 0 0 var(--spacing-xs);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.rhf-donate-wizard__label .required {
    color: var(--error-color, #c0392b);
}

.rhf-donate-wizard__currency {
    float: right;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 2px 8px;
}

.rhf-donate-wizard__frequency {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 2px solid var(--brand-accent);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.rhf-donate-wizard__freq-btn {
    margin: 0;
    padding: 12px 16px;
    border: none;
    background: var(--white);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.rhf-donate-wizard__freq-btn.is-active {
    background: var(--brand-accent);
    color: var(--white);
}

.rhf-donate-wizard__freq-btn:not(.is-active):hover {
    background: var(--bg-light);
}

.rhf-donate-wizard__amounts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rhf-donate-wizard__amount-btn {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
}

.rhf-donate-wizard__amount-btn.is-active,
.rhf-donate-wizard__amount-btn:hover {
    border-color: var(--brand-accent);
}

.rhf-donate-wizard__amount-btn.is-active {
    background: var(--brand-accent);
    color: var(--white);
}

.rhf-donate-wizard__custom-amount {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    box-sizing: border-box;
}

.rhf-donate-wizard__custom-amount:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 1px var(--brand-accent);
}

.rhf-donate-wizard__step-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.rhf-donate-wizard__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-dark);
    font-size: 1.25rem;
    cursor: pointer;
}

.rhf-donate-wizard__back:hover {
    background: var(--bg-light);
}

.rhf-donate-wizard__step-title {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    padding-right: 36px;
}

.rhf-donate-wizard__progress {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.rhf-donate-wizard__progress-fill {
    height: 100%;
    background: var(--brand-primary);
    transition: width 0.25s ease;
}

.rhf-donate-wizard__privacy {
    margin: 0 0 var(--spacing-md);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.rhf-donate-wizard__field {
    margin-bottom: var(--spacing-md);
}

.rhf-donate-wizard__field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.rhf-donate-wizard__field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    box-sizing: border-box;
}

.rhf-donate-wizard__field input:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 1px var(--brand-accent);
}

.rhf-donate-wizard__error {
    margin: 0 0 var(--spacing-sm);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: #fdecea;
    color: #c0392b;
    font-size: 0.9rem;
}

.rhf-donate-wizard__error:empty {
    display: none;
}

.rhf-donate-wizard__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: var(--spacing-sm);
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand-accent);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
}

.rhf-donate-wizard__cta:hover:not(:disabled) {
    filter: brightness(0.95);
}

.rhf-donate-wizard__cta:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.rhf-donate-wizard__secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: var(--spacing-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-primary);
}

.rhf-donate-wizard__secure svg {
    flex-shrink: 0;
}

.rhf-donate-wizard__stripe-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: var(--spacing-lg);
    color: var(--text-muted);
}

.rhf-donate-wizard__stripe-form[hidden],
.rhf-donate-wizard__stripe-loading[hidden] {
    display: none !important;
}

.rhf-donate-wizard__stripe-element {
    margin-bottom: var(--spacing-md);
}

.rhf-donate-wizard__summary {
    padding: 12px 14px;
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    font-size: 0.95rem;
}

.rhf-donate-wizard__summary strong {
    color: var(--brand-primary);
}

.rhf-donate-wizard__success {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-sm);
}

.rhf-donate-wizard__success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--spacing-md);
    border-radius: 50%;
    background: #d4edda;
    color: #155724;
    font-size: 1.75rem;
}

.rhf-donate-wizard__success h3 {
    margin: 0 0 var(--spacing-sm);
    font-size: 1.25rem;
    color: var(--brand-primary);
}

.rhf-donate-wizard__success p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.rhf-donate-wizard--inline {
    max-width: 520px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.rhf-donate-modal.is-processing .rhf-donate-modal__close {
    opacity: 0.35;
    pointer-events: none;
}

@media (max-width: 600px) {
    .rhf-donate-modal {
        padding: 0;
    }

    .rhf-donate-modal__dialog {
        width: 100%;
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
    }
}
