/* Church Giving — Frontend Styles
 * Campaign cards, giving history, simple give form
 * Design system tokens from DESIGN.md
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Instrument+Serif&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- Campaigns Grid ---- */
.church-campaigns { display: grid; gap: 24px; margin-bottom: 24px; }
.church-campaigns--1col { grid-template-columns: 1fr; }
.church-campaigns--2col { grid-template-columns: repeat(2, 1fr); }
.church-campaigns--3col { grid-template-columns: repeat(3, 1fr); }
.church-campaigns__empty { color: #888; font-style: italic; }
@media (max-width: 640px) {
    .church-campaigns--2col,
    .church-campaigns--3col { grid-template-columns: 1fr; }
}

/* ---- Campaign Card ---- */
.church-campaign-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 2px 20px rgba(29, 49, 49, 0.06);
    padding: 24px;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    transition: box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.church-campaign-card:hover { box-shadow: 0 4px 30px rgba(29, 49, 49, 0.10); }
.church-campaign-card__title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 24px;
    font-weight: 400;
    color: #1d3131;
    margin: 0 0 8px;
}
.church-campaign-card__desc {
    color: #888;
    font-size: 15px;
    margin-bottom: 16px;
    line-height: 1.6;
}
.church-campaign-card__bar-wrap {
    height: 8px;
    background: #e0dbd5;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 8px;
}
.church-campaign-card__bar {
    height: 100%;
    background: #3f6b6c;
    border-radius: 9999px;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.church-campaign-card__amounts {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    margin-bottom: 4px;
}
.church-campaign-card__raised {
    font-weight: 500;
    color: #3f6b6c;
}
.church-campaign-card__goal { color: #888; }
.church-campaign-card__pct {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}
.church-campaign-card__raised-no-goal {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 15px;
    font-weight: 500;
    color: #3f6b6c;
    margin-bottom: 16px;
}
.church-campaign-card__dates { font-size: 13px; color: #888; margin-bottom: 16px; }
.church-campaign-card__btn {
    display: inline-block;
    padding: 12px 24px;
    background: #3f6b6c;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 15px;
    min-height: 44px;
    transition: background 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.church-campaign-card__btn:hover { background: #345a5b; color: #fff; }
.church-campaign-card__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 107, 108, 0.15);
}

/* ---- Giving History ---- */
.church-giving-history {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    color: #464646;
}
.church-giving-history__year-heading {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 24px;
    font-weight: 400;
    color: #1d3131;
    margin-bottom: 16px;
}
.church-giving-history__empty { color: #888; font-style: italic; }
.church-giving-history__table-wrap { overflow-x: auto; }
.church-giving-history__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(29, 49, 49, 0.06);
}
.church-giving-history__table th {
    background: #f8f6f3;
    border-bottom: 1px solid #e0dbd5;
    padding: 10px 16px;
    text-align: left;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
}
.church-giving-history__table td {
    padding: 10px 16px;
    border-bottom: 1px solid #ece8e2;
    color: #464646;
}
.church-giving-history__table tbody tr:last-child td { border-bottom: none; }
.church-giving-history__table tfoot td {
    border-top: 2px solid #e0dbd5;
    border-bottom: none;
    font-weight: 700;
    background: #f8f6f3;
}
.church-giving-history__amount {
    text-align: right;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
}
.church-giving-history__login-msg { color: #888; }

/* ---- Give Form (Simple) ---- */
.church-give {
    width: 100%;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #464646;
}
.church-give__title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 32px;
    font-weight: 400;
    color: #1d3131;
    margin-bottom: 24px;
}

/* Amount buttons */
.church-give__amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.church-give__amount-btn {
    padding: 12px 20px;
    border: 2px solid #3f6b6c;
    background: transparent;
    color: #3f6b6c;
    border-radius: 8px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.2s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s;
}
.church-give__amount-btn:hover,
.church-give__amount-btn.is-active {
    background: #3f6b6c;
    color: #fff;
}
.church-give__amount-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 107, 108, 0.15);
}

/* Custom amount */
.church-give__custom { margin-bottom: 16px; }
.church-give__custom label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1d3131;
    margin-bottom: 6px;
}
.church-give__amount-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0dbd5;
    border-radius: 8px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 15px;
    color: #464646;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.church-give__amount-input:focus {
    outline: none;
    border-color: #3f6b6c;
    box-shadow: 0 0 0 3px rgba(63, 107, 108, 0.15);
}

/* Form fields */
.church-give__field { margin-bottom: 16px; }
.church-give__field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1d3131;
    margin-bottom: 6px;
}
.church-give__field input,
.church-give__field select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0dbd5;
    border-radius: 8px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 15px;
    color: #464646;
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.church-give__field input:focus,
.church-give__field select:focus {
    outline: none;
    border-color: #3f6b6c;
    box-shadow: 0 0 0 3px rgba(63, 107, 108, 0.15);
}

/* Recurring toggle */
.church-give__recurring {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #464646;
}

/* Card element */
.church-give__card-element {
    padding: 12px 16px;
    border: 1px solid #e0dbd5;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.church-give__card-element.StripeElement--focus {
    border-color: #3f6b6c;
    box-shadow: 0 0 0 3px rgba(63, 107, 108, 0.15);
}

/* Submit */
.church-give__submit {
    width: 100%;
    padding: 14px;
    background: #3f6b6c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.church-give__submit:hover:not(:disabled) { background: #345a5b; }
.church-give__submit:disabled { opacity: 0.7; cursor: not-allowed; }
.church-give__submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 107, 108, 0.3);
}

/* Messages */
.church-give__error {
    color: #721c24;
    background: #fdecea;
    border: 1px solid #f0c4be;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
}
.church-give__success {
    color: #2d5a27;
    background: #e8f5e4;
    border: 1px solid #c3ddbf;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
}

/* Spinner */
.church-give__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: church-give-spin .7s linear infinite;
    margin: 0 auto;
}
.church-give__submit.is-loading .church-give__spinner { display: inline-block; }
.church-give__submit.is-loading .church-give__label   { display: none; }

@keyframes church-give-spin { to { transform: rotate(360deg); } }

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
