/**
 * MLF Donation Form — Stylesheet
 * Version: 0.1.0
 *
 * Design tokens extracted from Figma prototype:
 * - Primary purple (header bg): #563061
 * - Accent orange (buttons, stats): #E8712B
 * - Impact purple (stats): #7B4080
 * - Background warm: #F7F5F2
 * - Card white: #FFFFFF
 * - Text dark: #1A1A1A
 * - Text muted: #6B7280
 * - Border light: #E5E7EB
 *
 * Architecture: BEM naming with mlf-donate prefix to avoid theme collisions.
 * Mobile-first: base styles are mobile, media queries add desktop overrides.
 */

/* ========================================
   DESIGN TOKENS (CSS Custom Properties)
   ======================================== */

.mlf-donate {
    --mlf-purple-deep: #563061;
    --mlf-purple-mid: #7B4080;
    --mlf-purple-light: #9B5B8E;
    --mlf-orange: #eea526;
    --mlf-orange-hover: #d4941f;
    --mlf-orange-light: #FFF8E8;
    --mlf-bg-warm: #F7F5F2;
    --mlf-white: #FFFFFF;
    --mlf-text-dark: #1A1A1A;
    --mlf-text-body: #374151;
    --mlf-text-muted: #6B7280;
    --mlf-border: #E5E7EB;
    --mlf-border-focus: #32b2ca;
    --mlf-green-check: #16A34A;
    --mlf-error: #DC2626;
    --mlf-radius: 8px;
    --mlf-radius-lg: 12px;
    --mlf-radius-pill: 50px;
    --mlf-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --mlf-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --mlf-font: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mlf-transition: 0.2s ease;
}

/* ========================================
   BASE RESET (scoped to plugin only)
   ======================================== */

.mlf-donate {
    font-family: var(--mlf-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--mlf-text-body);
    background-color: var(--mlf-bg-warm);
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1rem 1rem;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mlf-donate *,
.mlf-donate *::before,
.mlf-donate *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Prevent WordPress theme from forcing wider widths on children */
.mlf-donate > * {
    max-width: 100%;
}

/* ========================================
   HEADER
   ======================================== */

.mlf-donate__header {
    background: var(--mlf-purple-deep);
    color: var(--mlf-white);
    text-align: center;
    padding: 1.75rem 1rem 1.5rem;
    border-radius: var(--mlf-radius-lg) var(--mlf-radius-lg) 0 0;
    overflow: hidden;
    word-wrap: break-word;
}

.mlf-donate__header-badge {
    display: inline-block;
    background-color: var(--mlf-orange);
    color: var(--mlf-white);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.375rem 1.25rem;
    border-radius: var(--mlf-radius-pill);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.mlf-donate__header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: var(--mlf-white);
    letter-spacing: -0.01em;
}

.mlf-donate__header-subtitle {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 480px;
    margin: 0 auto 1.25rem;
    line-height: 1.5;
}

.mlf-donate__header-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.mlf-donate__trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: var(--mlf-radius-pill);
    white-space: nowrap;
}

.mlf-donate__trust-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ========================================
   IMPACT STRIP
   ======================================== */

.mlf-donate__impact-strip {
    background-color: var(--mlf-white);
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--mlf-border);
}

.mlf-donate__impact-stat {
    margin-bottom: 1.25rem;
}

.mlf-donate__impact-stat:last-child {
    margin-bottom: 0;
}

.mlf-donate__impact-number {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.mlf-donate__impact-number--orange {
    color: var(--mlf-orange);
}

.mlf-donate__impact-number--purple {
    color: var(--mlf-purple-mid);
}

.mlf-donate__impact-number--dark {
    color: var(--mlf-text-dark);
}

.mlf-donate__impact-divider {
    width: 40px;
    height: 3px;
    margin: 0.5rem auto;
    border-radius: 2px;
}

.mlf-donate__impact-divider--orange {
    background-color: var(--mlf-orange);
}

.mlf-donate__impact-divider--purple {
    background-color: var(--mlf-purple-mid);
}

.mlf-donate__impact-divider--dark {
    background-color: var(--mlf-text-dark);
}

.mlf-donate__impact-label {
    font-size: 0.875rem;
    color: var(--mlf-text-muted);
    line-height: 1.4;
}

/* ========================================
   IMPACT MODE B: TESTIMONIAL QUOTE
   ======================================== */

.mlf-donate__impact-strip--quote {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 1.75rem 1.5rem;
    gap: 0.75rem;
}

.mlf-donate__quote-icon {
    color: var(--mlf-orange);
    line-height: 1;
}

.mlf-donate__quote-text {
    font-size: 1rem;
    font-style: italic;
    color: var(--mlf-text-body);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    border: none;
}

.mlf-donate__quote-author {
    font-size: 0.875rem;
    color: var(--mlf-text-muted);
    font-style: normal;
}

/* ========================================
   IMPACT MODE C: STORY CARD
   ======================================== */

.mlf-donate__impact-strip--story {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 1.75rem 1.5rem;
    gap: 0.75rem;
}

.mlf-donate__story-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--mlf-text-dark);
    margin: 0;
    line-height: 1.3;
}

.mlf-donate__story-body {
    font-size: 0.9375rem;
    color: var(--mlf-text-body);
    line-height: 1.6;
    margin: 0;
}

.mlf-donate__story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.mlf-donate__story-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--mlf-text-muted);
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
}

/* ========================================
   IMPACT MODE D: TRANSPARENCY BARS
   ======================================== */

.mlf-donate__impact-strip--transparency {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding: 1.75rem 1.5rem;
    gap: 0.75rem;
}

.mlf-donate__transparency-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--mlf-text-dark);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.mlf-donate__transparency-bar {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mlf-donate__transparency-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.mlf-donate__transparency-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mlf-text-dark);
}

.mlf-donate__transparency-pct {
    font-size: 0.9375rem;
    font-weight: 700;
}

.mlf-donate__transparency-pct--orange { color: var(--mlf-orange); }
.mlf-donate__transparency-pct--purple { color: var(--mlf-purple-mid); }
.mlf-donate__transparency-pct--dark   { color: var(--mlf-text-dark); }
.mlf-donate__transparency-pct--green  { color: var(--mlf-green-check); }

.mlf-donate__transparency-track {
    width: 100%;
    height: 8px;
    background-color: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.mlf-donate__transparency-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.mlf-donate__transparency-fill--orange { background: linear-gradient(90deg, var(--mlf-orange), #F59E0B); }
.mlf-donate__transparency-fill--purple { background: linear-gradient(90deg, var(--mlf-purple-mid), #8B5CF6); }
.mlf-donate__transparency-fill--dark   { background: linear-gradient(90deg, #374151, #6B7280); }
.mlf-donate__transparency-fill--green  { background: linear-gradient(90deg, var(--mlf-green-check), #34D399); }

/* ========================================
   FORM CARD (container for sections 2-5)
   ======================================== */

.mlf-donate__form-card {
    background-color: var(--mlf-white);
    border-radius: 0 0 var(--mlf-radius-lg) var(--mlf-radius-lg);
    box-shadow: var(--mlf-shadow);
    padding: 1rem;
}

/* When header is hidden, round the top of whichever element comes first */
.mlf-donate--no-header .mlf-donate__impact-strip {
    border-radius: var(--mlf-radius-lg) var(--mlf-radius-lg) 0 0;
}
.mlf-donate--no-header .mlf-donate__impact-strip + .mlf-donate__form-card {
    border-radius: 0 0 var(--mlf-radius-lg) var(--mlf-radius-lg);
}
.mlf-donate--no-header .mlf-donate__form-card:first-child {
    border-radius: var(--mlf-radius-lg);
}

/* ========================================
   SHARED FORM ELEMENTS
   ======================================== */

.mlf-donate__fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.mlf-donate__legend {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--mlf-text-dark);
    margin-bottom: 0.75rem;
    width: 100%;
}

/* ========================================
   SECTION 2a: FREQUENCY SELECTOR
   ======================================== */

.mlf-donate__frequency-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.mlf-donate__freq-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.5rem;
    font-family: var(--mlf-font);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mlf-text-body);
    background-color: var(--mlf-bg-warm);
    border: 1px solid var(--mlf-border);
    border-radius: var(--mlf-radius-lg);
    cursor: pointer;
    transition: all var(--mlf-transition);
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.3;
    white-space: nowrap;
    min-width: 0;
}

.mlf-donate__freq-btn:hover {
    border-color: var(--mlf-purple-mid);
    color: var(--mlf-purple-mid);
    background-color: rgba(86, 48, 98, 0.08);
}

.mlf-donate__freq-btn:focus-visible {
    outline: 2px solid var(--mlf-purple-mid);
    outline-offset: 2px;
}

.mlf-donate__freq-btn--active,
.mlf-donate__freq-btn--active:hover {
    background-color: var(--mlf-purple-deep);
    border-color: var(--mlf-purple-deep);
    color: var(--mlf-white);
    font-weight: 600;
}

/* ========================================
   SECTION 2b: CURRENCY SELECTOR
   ======================================== */

.mlf-donate__currency-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mlf-donate__currency-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mlf-text-muted);
    white-space: nowrap;
}

.mlf-donate__currency-select-wrap {
    position: relative;
    display: inline-flex;
}

.mlf-donate__currency-select {
    font-family: var(--mlf-font);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mlf-text-dark);
    background-color: var(--mlf-bg-warm);
    border: 1px solid var(--mlf-border);
    border-radius: var(--mlf-radius);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.4;
}

.mlf-donate__currency-select:focus-visible {
    outline: 2px solid var(--mlf-purple-mid);
    outline-offset: 1px;
}

.mlf-donate__currency-chevron {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    color: var(--mlf-text-muted);
}

/* ========================================
   SECTION 2b: AMOUNT GRID
   ======================================== */

.mlf-donate__amount-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* 5-column grid when custom amount is inline */
.mlf-donate__amount-grid--with-custom {
    grid-template-columns: repeat(5, 1fr);
    margin-bottom: 0;
}

.mlf-donate__amount-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.5rem;
    font-family: var(--mlf-font);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--mlf-text-dark);
    background-color: var(--mlf-bg-warm);
    border: 1px solid var(--mlf-border);
    border-radius: var(--mlf-radius-lg);
    cursor: pointer;
    transition: all var(--mlf-transition);
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.3;
    min-width: 0;
}

.mlf-donate__amount-btn:hover {
    border-color: var(--mlf-purple-mid);
    color: var(--mlf-purple-mid);
    background-color: rgba(86, 48, 98, 0.08);
}

.mlf-donate__amount-btn:focus-visible {
    outline: 2px solid var(--mlf-purple-mid);
    outline-offset: 2px;
}

.mlf-donate__amount-btn--active,
.mlf-donate__amount-btn--active:hover {
    background-color: var(--mlf-purple-deep);
    border-color: var(--mlf-purple-deep);
    color: var(--mlf-white);
}

.mlf-donate__amount-symbol {
    margin-right: 0.125rem;
}

/* ========================================
   SECTION 2b: CUSTOM AMOUNT INPUT
   ======================================== */

.mlf-donate__custom-amount {
    margin-top: 0;
}

/* When inside the 5-col grid */
.mlf-donate__amount-grid--with-custom .mlf-donate__custom-amount {
    display: flex;
    align-items: stretch;
}

.mlf-donate__amount-grid--with-custom .mlf-donate__custom-input-wrap {
    width: 100%;
}

.mlf-donate__custom-label {
    display: none;
}

.mlf-donate__custom-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.mlf-donate__custom-prefix {
    position: absolute;
    left: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--mlf-text-muted);
    pointer-events: none;
    line-height: 1;
    transition: color var(--mlf-transition);
}

.mlf-donate__custom-input--active ~ .mlf-donate__custom-prefix,
.mlf-donate__custom-input-wrap:has(.mlf-donate__custom-input--active) .mlf-donate__custom-prefix {
    color: rgba(255, 255, 255, 0.9);
}

.mlf-donate__custom-input {
    width: 100%;
    font-family: var(--mlf-font);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--mlf-text-dark);
    background-color: var(--mlf-bg-warm);
    border: 1px solid var(--mlf-border);
    border-radius: var(--mlf-radius);
    padding: 0.2rem 0.5rem 0.2rem 1.5rem;
    transition: all var(--mlf-transition);
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.3;
    height: 100%;
    text-align: center;
}

.mlf-donate__custom-input:hover {
    border-color: #D1D5DB;
}

.mlf-donate__custom-input:focus {
    outline: none;
    border-color: var(--mlf-purple-mid);
    box-shadow: 0 0 0 3px rgba(86, 48, 98, 0.15);
}

/* Active state when user has typed a value */
.mlf-donate__custom-input--active {
    background-color: var(--mlf-purple-mid);
    border-color: var(--mlf-purple-mid);
    color: var(--mlf-white);
}

.mlf-donate__custom-input--active::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.mlf-donate__custom-input--active:focus {
    background-color: var(--mlf-purple-mid);
    border-color: var(--mlf-purple-mid);
    color: var(--mlf-white);
    box-shadow: 0 0 0 3px rgba(107, 45, 91, 0.3);
}

.mlf-donate__custom-input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

/* Remove number input spinners */
.mlf-donate__custom-input::-webkit-outer-spin-button,
.mlf-donate__custom-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mlf-donate__custom-input[type="number"] {
    -moz-appearance: textfield;
}

/* ========================================
   SECTION 4a: DONOR DETAILS — FORM FIELDS
   ======================================== */

.mlf-donate__field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 100%;
}

/* 3-column grid for city/postcode/phone row */
.mlf-donate__field-grid--3col {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0 0.75rem;
    align-items: start;
}

/* Constrain specific fields — desktop only */
@media (min-width: 640px) {
    .mlf-donate__field--email .mlf-donate__input,
    .mlf-donate__input--half {
        max-width: calc(50% - 0.5rem);
    }

    .mlf-donate__field--phone .mlf-donate__field,
    .mlf-donate__input--phone {
        max-width: calc(50% - 0.5rem);
    }
}

.mlf-donate__field {
    margin-bottom: 0.5rem;
}

.mlf-donate__field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mlf-text-dark);
    margin-bottom: 0.3125rem;
}

/* Screen-reader only label — visually hidden but accessible */
.mlf-donate__field-label--sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mlf-donate__required {
    color: var(--mlf-error);
    font-weight: 600;
}

.mlf-donate__optional {
    color: var(--mlf-text-muted);
    font-weight: 400;
    font-size: 0.8125rem;
}

.mlf-donate__input {
    width: 100%;
    font-family: var(--mlf-font);
    font-size: 1rem;
    color: var(--mlf-text-dark);
    background-color: var(--mlf-white);
    border: 2px solid var(--mlf-border);
    border-radius: var(--mlf-radius);
    padding: 0.4rem 0.625rem;
    transition: border-color var(--mlf-transition), box-shadow var(--mlf-transition);
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.4;
    font-size: 0.9375rem;
}

.mlf-donate__input:hover {
    border-color: #D1D5DB;
}

.mlf-donate__input:focus {
    outline: none;
    border-color: var(--mlf-purple-mid);
    box-shadow: 0 0 0 3px rgba(86, 48, 98, 0.15);
}

.mlf-donate__input::placeholder {
    color: #9CA3AF;
}

/* Validation error state */
.mlf-donate__input--error {
    border-color: var(--mlf-error);
}

.mlf-donate__input--error:focus {
    border-color: var(--mlf-error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.mlf-donate__field-error {
    display: none;
    font-size: 0.8125rem;
    color: var(--mlf-error);
    margin-top: 0.25rem;
}

.mlf-donate__field--has-error .mlf-donate__field-error {
    display: block;
}

/* ========================================
   SECTION 4a: SELECT / DROPDOWN (Country)
   ======================================== */

.mlf-donate__select-wrap {
    position: relative;
    display: flex;
}

.mlf-donate__select {
    width: 100%;
    font-family: var(--mlf-font);
    font-size: 1rem;
    color: var(--mlf-text-dark);
    background-color: var(--mlf-white);
    border: 2px solid var(--mlf-border);
    border-radius: var(--mlf-radius);
    padding: 0.4rem 2.25rem 0.4rem 0.625rem;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.4;
    font-size: 0.9375rem;
    transition: border-color var(--mlf-transition);
}

.mlf-donate__select:hover {
    border-color: #D1D5DB;
}

.mlf-donate__select:focus {
    outline: none;
    border-color: var(--mlf-purple-mid);
    box-shadow: 0 0 0 3px rgba(86, 48, 98, 0.15);
}

.mlf-donate__select-chevron {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    color: var(--mlf-text-muted);
}

/* Placeholder style (when disabled "Select your country" is shown) */
.mlf-donate__select:invalid {
    color: #9CA3AF;
}

/* ========================================
   SECTION 4b: COMMUNICATION PREFERENCES
   ======================================== */

.mlf-donate__comms-intro {
    font-size: 0.875rem;
    color: var(--mlf-text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.mlf-donate__comms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.mlf-donate__hear-other-wrap {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

/* Heard about checkboxes - compact 3-column grid */
.mlf-donate__hear-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.375rem;
}

.mlf-donate__hear-grid .mlf-donate__checkbox-row {
    margin: 0;
}

.mlf-donate__hear-grid .mlf-donate__checkbox-text {
    font-size: 0.8125rem;
}

/* ========================================
   SECTION 3a: IMPACT STATEMENT
   ======================================== */

.mlf-donate__impact-statement {
    margin-bottom: 1.5rem;
}

.mlf-donate__impact-statement[hidden] {
    display: none;
}

.mlf-donate__impact-statement-inner {
    background: var(--mlf-bg-warm);
    border: 1px solid var(--mlf-border);
    border-radius: var(--mlf-radius);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.mlf-donate__impact-statement-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--mlf-purple-mid);
    margin-top: 2px;
}

.mlf-donate__impact-statement-text {
    font-size: 0.9375rem;
    color: var(--mlf-text-dark);
    line-height: 1.5;
}

/* ========================================
   SECTION DIVIDER
   ======================================== */

.mlf-donate__section-divider {
    height: 1px;
    background-color: var(--mlf-border);
    margin: 0 0 1rem;
}

/* ========================================
   SHARED CHECKBOX STYLES
   ======================================== */

.mlf-donate__checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

/* Hide native checkbox — custom box replaces it */
.mlf-donate__checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mlf-donate__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.mlf-donate__checkbox-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--mlf-border);
    border-radius: 4px;
    background-color: var(--mlf-white);
    transition: all var(--mlf-transition);
    margin-top: 1px;
}

.mlf-donate__checkbox-tick {
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity var(--mlf-transition);
    color: var(--mlf-white);
}

/* Checked state — purple for Gift Aid */
.mlf-donate__checkbox:checked + .mlf-donate__checkbox-label .mlf-donate__checkbox-box {
    background-color: var(--mlf-purple-mid);
    border-color: var(--mlf-purple-mid);
}

.mlf-donate__checkbox:checked + .mlf-donate__checkbox-label .mlf-donate__checkbox-tick {
    opacity: 1;
}

/* Checked state — green variant for fee coverage */
.mlf-donate__checkbox:checked + .mlf-donate__checkbox-label .mlf-donate__checkbox-box--green {
    background-color: var(--mlf-green-check);
    border-color: var(--mlf-green-check);
}

/* Hover state — purple border */
.mlf-donate__checkbox-label:hover .mlf-donate__checkbox-box {
    border-color: var(--mlf-purple-mid);
    background-color: rgba(86, 48, 98, 0.06);
}

/* Focus visible */
.mlf-donate__checkbox:focus-visible + .mlf-donate__checkbox-label .mlf-donate__checkbox-box {
    outline: 2px solid var(--mlf-purple-mid);
    outline-offset: 2px;
}

.mlf-donate__checkbox-text {
    font-size: 0.9375rem;
    color: var(--mlf-text-dark);
    line-height: 1.5;
}

.mlf-donate__checkbox-text strong {
    font-weight: 600;
}

/* Gift Aid checkbox label - same size as other checkboxes */
.mlf-donate__giftaid .mlf-donate__checkbox-text {
    font-size: 0.9375rem;
}

.mlf-donate__giftaid .mlf-donate__checkbox-text strong {
    font-size: 0.9375rem;
    font-weight: 600;
}

/* ========================================
   SECTION 3b: GIFT AID
   ======================================== */

.mlf-donate__giftaid {
    margin-bottom: 0;
}

.mlf-donate__giftaid-details {
    margin-left: calc(22px + 0.75rem); /* Align with checkbox text */
    margin-top: 0.5rem;
}

.mlf-donate__giftaid-boost {
    font-size: 0.875rem;
    color: var(--mlf-purple-mid);
    background-color: #F5F0F5;
    border-radius: var(--mlf-radius);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.mlf-donate__giftaid-boost[hidden] {
    display: none;
}

.mlf-donate button.mlf-donate__giftaid-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    font-family: var(--mlf-font);
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    color: var(--mlf-purple-mid);
    cursor: pointer;
    padding: 0.25rem 0;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.mlf-donate button.mlf-donate__giftaid-toggle:hover {
    color: var(--mlf-purple-deep);
}

.mlf-donate button.mlf-donate__giftaid-toggle:focus-visible {
    outline: 2px solid var(--mlf-purple-mid);
    outline-offset: 2px;
    border-radius: 2px;
}

.mlf-donate__giftaid-chevron {
    width: 14px;
    height: 14px;
    transition: transform var(--mlf-transition);
}

.mlf-donate__giftaid-toggle[aria-expanded="true"] .mlf-donate__giftaid-chevron {
    transform: rotate(180deg);
}

.mlf-donate__giftaid-info {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--mlf-text-muted);
    line-height: 1.3;
}

.mlf-donate__giftaid-info[hidden] {
    display: none;
}

.mlf-donate .mlf-donate__giftaid-info p {
    margin: 0 0 0.25rem !important;
    font-size: 0.8125rem !important;
    line-height: 1.3 !important;
}

.mlf-donate .mlf-donate__giftaid-info p:last-child {
    margin-bottom: 0 !important;
}

/* ========================================
   SECTION 3c: FEE COVERAGE
   ======================================== */

.mlf-donate__fee-cover {
    margin-bottom: 0;
}

.mlf-donate__fee-amount {
    display: inline;
    font-weight: 400;
    color: var(--mlf-text-muted);
    font-size: 0.875rem;
    margin-left: 0.25rem;
}

.mlf-donate__fee-message {
    margin-left: calc(22px + 0.75rem);
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--mlf-text-muted);
    line-height: 1.5;
}

.mlf-donate__fee-heart {
    margin-right: 0.25rem;
}

/* ========================================
   SECTION 5a: PAYMENT SUMMARY
   ======================================== */

.mlf-donate__summary {
    background-color: var(--mlf-bg-warm);
    border: 1px solid var(--mlf-border);
    border-radius: var(--mlf-radius);
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
}

.mlf-donate__summary-heading {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--mlf-text-dark);
    margin-bottom: 0.75rem;
}

.mlf-donate__summary-rows {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.mlf-donate__summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.875rem;
    color: var(--mlf-text-body);
}

.mlf-donate__summary-row[hidden] {
    display: none;
}

.mlf-donate__summary-label {
    color: var(--mlf-text-muted);
}

.mlf-donate__summary-value {
    font-weight: 600;
    text-align: right;
}

.mlf-donate__summary-value--green {
    color: var(--mlf-green-check);
}

.mlf-donate__summary-divider {
    height: 1px;
    background-color: var(--mlf-border);
    margin: 0.375rem 0;
}

.mlf-donate__summary-row--total {
    font-size: 1rem;
}

.mlf-donate__summary-row--total .mlf-donate__summary-label {
    font-weight: 600;
    color: var(--mlf-text-dark);
}

.mlf-donate__summary-row--total .mlf-donate__summary-value {
    font-size: 1.125rem;
    color: var(--mlf-text-dark);
}

.mlf-donate__summary-row--impact {
    font-size: 0.8125rem;
}

.mlf-donate__summary-row--impact .mlf-donate__summary-label {
    font-style: italic;
}

/* ========================================
   SECTION 5b: VALIDATION MESSAGE
   ======================================== */

.mlf-donate__validation-msg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--mlf-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--mlf-error);
}

.mlf-donate__validation-msg[hidden] {
    display: none;
}

.mlf-donate__validation-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ========================================
   SECTION 5c: SUBMIT BUTTON
   ======================================== */

.mlf-donate__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    min-width: 280px;
    max-width: 100%;
    padding: 0.875rem 2rem;
    font-family: var(--mlf-font);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--mlf-white);
    background: var(--mlf-purple-mid);
    border: none;
    border-radius: var(--mlf-radius-lg);
    cursor: pointer;
    transition: all var(--mlf-transition);
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 2px 8px rgba(86, 48, 98, 0.3);
    line-height: 1.3;
}

.mlf-donate__submit:hover {
    background: var(--mlf-purple-deep);
    box-shadow: 0 4px 12px rgba(86, 48, 98, 0.4);
    transform: translateY(-1px);
}

.mlf-donate__submit:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(91, 62, 150, 0.3);
}

.mlf-donate__submit:focus-visible {
    outline: 2px solid var(--mlf-purple-mid);
    outline-offset: 3px;
}

.mlf-donate__submit-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform var(--mlf-transition);
}

.mlf-donate__submit:hover .mlf-donate__submit-arrow {
    transform: translateX(3px);
}

.mlf-donate__submit-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--mlf-text-muted);
    text-align: center;
    margin-top: 0.75rem;
    margin-bottom: 0;
    line-height: 1.4;
}

.mlf-donate__submit-note-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ========================================
   SECTION 5d: REASSURANCE FOOTER
   ======================================== */

.mlf-donate__footer {
    margin-top: 1.5rem;
    padding: 1.5rem 1rem;
    background-color: var(--mlf-white);
    border-radius: var(--mlf-radius-lg);
    box-shadow: var(--mlf-shadow);
}

.mlf-donate__footer-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mlf-donate__footer-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--mlf-text-body);
    line-height: 1.4;
}

.mlf-donate__footer-item strong {
    display: block;
    font-weight: 600;
    color: var(--mlf-text-dark);
    font-size: 0.875rem;
}

.mlf-donate__footer-item span {
    color: var(--mlf-text-muted);
}

.mlf-donate__footer-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--mlf-purple-mid);
    margin-top: 1px;
}

.mlf-donate__footer-link {
    color: var(--mlf-purple-mid);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.mlf-donate__footer-link:hover {
    color: var(--mlf-purple-deep);
}

/* ========================================
   CHECKOUT POPUP (iframe overlay)
   ======================================== */

.mlf-checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.mlf-checkout-overlay--active {
    background-color: rgba(0, 0, 0, 0.6);
}

.mlf-checkout-modal {
    width: 100%;
    max-width: 440px;
    height: 96vh;
    max-height: 860px;
    background-color: var(--mlf-white, #FFFFFF);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

.mlf-checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background-color: #1F2937;
    color: #FFFFFF;
    flex-shrink: 0;
}

.mlf-checkout-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.mlf-checkout-header-text {
    font-family: var(--mlf-font, system-ui, sans-serif);
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    letter-spacing: 0.02em;
}

.mlf-checkout-header-sub {
    font-family: var(--mlf-font, system-ui, sans-serif);
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.01em;
}

.mlf-checkout-close {
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

.mlf-checkout-close:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.1);
}

.mlf-checkout-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    flex: 1;
}

.mlf-checkout-spinner p {
    font-family: var(--mlf-font, system-ui, sans-serif);
    font-size: 0.875rem;
    color: #6B7280;
    margin-top: 1rem;
}

.mlf-checkout-spinner-ring {
    width: 36px;
    height: 36px;
    border: 3px solid #E5E7EB;
    border-top-color: var(--mlf-orange, #E8712B);
    border-radius: 50%;
    animation: mlf-spin 0.8s linear infinite;
}

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

.mlf-checkout-iframe {
    flex: 1;
    width: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Mobile: full-screen popup */
@media (max-width: 480px) {
    .mlf-checkout-overlay {
        padding: 0;
    }

    .mlf-checkout-modal {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* ========================================
   THANK-YOU PAGE
   ======================================== */

.mlf-donate__thankyou-card {
    background-color: var(--mlf-white);
    border-radius: var(--mlf-radius-lg);
    box-shadow: var(--mlf-shadow);
    padding: 2rem 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.mlf-donate__thankyou-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-radius: 50%;
    margin-bottom: 1.25rem;
    color: #059669;
}

.mlf-donate__thankyou-heading {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--mlf-text-dark);
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.mlf-donate__thankyou-message {
    font-size: 0.9375rem;
    color: var(--mlf-text-body);
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.mlf-donate__thankyou-details {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    background-color: var(--mlf-bg-warm);
    border-radius: var(--mlf-radius);
    margin-bottom: 1.5rem;
}

.mlf-donate__thankyou-detail {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--mlf-text-body);
    line-height: 1.5;
}

.mlf-donate__thankyou-detail strong {
    color: var(--mlf-text-dark);
}

.mlf-donate__thankyou-detail-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--mlf-purple-mid);
    margin-top: 2px;
}

.mlf-donate__thankyou-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mlf-donate__thankyou-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: var(--mlf-radius-lg);
    font-family: var(--mlf-font);
    font-size: 1.0625rem;
    font-weight: 600;
    min-width: 200px;
    text-decoration: none;
    transition: all var(--mlf-transition);
    cursor: pointer;
}

.mlf-donate__thankyou-btn--primary {
    background: var(--mlf-purple-mid);
    color: var(--mlf-white);
    box-shadow: 0 2px 8px rgba(86, 48, 98, 0.3);
}

.mlf-donate__thankyou-btn--primary:hover {
    background: var(--mlf-purple-deep);
    box-shadow: 0 4px 12px rgba(86, 48, 98, 0.4);
    transform: translateY(-1px);
    color: var(--mlf-white);
    text-decoration: none;
}

.mlf-donate__thankyou-btn--secondary {
    background-color: var(--mlf-white);
    color: var(--mlf-purple-mid);
    border: 2px solid var(--mlf-purple-mid);
}

.mlf-donate__thankyou-btn--secondary:hover {
    background-color: var(--mlf-purple-mid);
    color: var(--mlf-white);
    text-decoration: none;
}

/* ========================================
   RESPONSIVE — Tablet (640px+)
   ======================================== */

@media (min-width: 640px) {
    .mlf-donate {
        padding: 1.5rem 1.5rem 1rem;
    }

    .mlf-donate__header {
        padding: 2.5rem 2rem 2rem;
    }

    .mlf-donate__header-title {
        font-size: 2rem;
    }

    .mlf-donate__trust-badge {
        font-size: 0.75rem;
        padding: 0.3125rem 0.75rem;
    }

    .mlf-donate__impact-strip {
        display: flex;
        justify-content: center;
        gap: 3rem;
        padding: 2.5rem 2rem;
    }

    .mlf-donate__impact-stat {
        margin-bottom: 0;
    }

    .mlf-donate__impact-number {
        font-size: 2.25rem;
    }

    .mlf-donate__form-card {
        padding: 1.25rem;
    }

    .mlf-donate__freq-btn {
        padding: 0.625rem 1rem;
        font-size: 0.9375rem;
    }

    .mlf-donate__amount-btn {
        padding: 0.75rem 1rem;
        font-size: 1.125rem;
    }

    /* Section 2: keep 4-column amount grid on tablet */
    .mlf-donate__amount-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* 5-column when custom is inline */
    .mlf-donate__amount-grid--with-custom {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Section 4: 2-column field grid on tablet */
    .mlf-donate__field-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0 1rem;
    }

    /* Section 5: Footer horizontal */
    .mlf-donate__footer-items {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }

    .mlf-donate__footer-item {
        flex: 1;
        text-align: center;
        flex-direction: column;
        align-items: center;
    }

    /* Thank-you page */
    .mlf-donate__thankyou-card {
        padding: 2.5rem 2rem;
    }

    .mlf-donate__thankyou-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* ========================================
   RESPONSIVE — Desktop (1024px+)
   ======================================== */

@media (min-width: 1024px) {
    .mlf-donate__header {
        padding: 3rem 2.5rem 2.25rem;
    }

    .mlf-donate__header-title {
        font-size: 2.25rem;
    }

    .mlf-donate__header-subtitle {
        font-size: 1rem;
    }

    .mlf-donate__impact-strip {
        gap: 4rem;
        padding: 2.5rem 3rem;
    }

    .mlf-donate__impact-number {
        font-size: 2.75rem;
    }

    .mlf-donate__form-card {
        padding: 1.5rem;
    }
}
/* ========================================
   HEADER LOGO
   ======================================== */

.mlf-donate__header-logo-wrap {
    margin-bottom: 1rem;
}

.mlf-donate__header-logo {
    width: auto;
    height: 80px;
    border-radius: 0;
    object-fit: contain;
}

/* ========================================
   THANK YOU PAGE — LEFT-ALIGNED HEADER
   ======================================== */

.mlf-donate__header--thankyou {
    text-align: left;
    padding-top: 0;
    padding-bottom: 0.875rem;
}

.mlf-donate__header--thankyou .mlf-donate__header-subtitle {
    margin: 0 0 0.5rem;
    max-width: none;
}

.mlf-donate__header--thankyou .mlf-donate__header-logo {
    display: block;
    height: 140px; /* 80px × 1.75 — Thank You page only */
    margin: -24px 0 0 -31px; /* -24px clips PNG's 52px built-in top space to ~28px; -31px aligns left edge with title */
}

/* ========================================
   HIDE STAGING THEME CHROME
   Scoped to Pantheon staging only via the
   .pantheon-staging body class added by
   the plugin's template_redirect hook.
   The live site (microloanfoundation.org.uk)
   never gets this class so nav/footer are
   always visible there.
   ======================================== */

body.pantheon-staging #wpadminbar,
body.pantheon-staging .site-header,
body.pantheon-staging .site-footer,
body.pantheon-staging header.site-header,
body.pantheon-staging footer.site-footer,
body.pantheon-staging #masthead,
body.pantheon-staging #colophon,
body.pantheon-staging .main-navigation,
body.pantheon-staging .site-branding,
body.pantheon-staging nav.main-navigation,
body.pantheon-staging header.mainHead,
body.pantheon-staging footer,
body.pantheon-staging header.wp-block-template-part,
body.pantheon-staging footer.wp-block-template-part,
body.pantheon-staging .wp-site-blocks > header,
body.pantheon-staging .wp-site-blocks > footer {
    display: none !important;
}

body.pantheon-staging {
    padding-top: 0 !important;
    margin-top: 0 !important;
    overflow-x: hidden;
}

body.pantheon-staging .site-content,
body.pantheon-staging #content,
body.pantheon-staging .content-area {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Centre the submit button */
.mlf-donate__submit-wrap {
    text-align: center;
}

/* Gift Aid full declaration text */
.mlf-donate__giftaid-declaration {
    display: block;
    font-size: 0.875rem;
    color: var(--mlf-text-muted);
    margin-top: 0.375rem;
    line-height: 1.4;
    font-weight: 400;
}

/* Half-width input - desktop only */
@media (min-width: 640px) {
    .mlf-donate__input--half {
        max-width: calc(50% - 0.5rem);
    }
}

/* Mobile: stack city/postcode/phone */
@media (max-width: 639px) {
    .mlf-donate__field-grid--3col {
        grid-template-columns: 1fr 1fr;
    }

    .mlf-donate__field-grid--3col .mlf-donate__field:first-child {
        grid-column: 1 / -1;
    }

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

    /* Mobile amounts: 3 on first row, 2 on second */
    .mlf-donate__amount-grid--with-custom {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Gift Aid header with logo */
.mlf-donate__giftaid-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.mlf-donate__giftaid-logo {
    height: 52px;
    width: auto;
    flex-shrink: 0;
}