/* ================================
   Donation page — option controls
   Button-style radios that fill container
================================= */

/* Base reset for donation option groups */
.donation-amounts,
.donation-frequency,
.donation-payment-method {
    margin: 0;
    padding: 0;
}

/* Remove default fieldset border for cleaner layout */
.donation-form fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/* The grid / segmented surface that acts like an input surface.
   This container will provide the background and border; individual
   option labels become segments that fill height and width. */
.amounts-grid,
.donation-frequency > div,
.donation-payment-method > div {
    display: flex;
    width: 100%;
    gap: 0; /* segments touch each other */
    border-radius: 10px;
    overflow: hidden; /* outer rounding only */
    background: var(--color-primary-500); /* same surface as other inputs */
    border: 1px solid var(--color-primary-700);
    box-sizing: border-box;
}

/* Put a consistent min-height so the segmented control matches other inputs.
   Matches vertical rhythm of .input-group__inner (padding 8px + comfortable height). */
.amounts-grid,
.donation-frequency > div,
.donation-payment-method > div {
    min-height: 52px;
    border: 1px solid var(--color-primary-700);
}

/* Each option wrapper keeps input and visible label */
.amount-option,
.frequency-option,
.payment-option {
    position: relative;
    display: block;
    flex: 1; /* equally distributed */
    box-sizing: border-box;
}

/* Hide native radio visually but keep it accessible */
.amount-option input,
.frequency-option input,
.payment-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Visual label — fills the entire segment (height & width) */
.amount-option__label,
.frequency-option__label,
.payment-option__label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    margin: 0;
    flex: 1;
    box-sizing: border-box;
    line-height: 52px;
    /* match container surface so the segments appear as one field */
    background: var(--color-primary-500);
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 0.95rem;

    border: 0; /* label itself doesn't have outer border; container shows border */
    border-right: 1px solid var(--color-primary-700); /* thin separator */
    transition: background 160ms ease, color 140ms ease, border-color 160ms ease, transform 120ms ease;
}

/* Remove last separator to avoid double border at the end */
.amount-option:last-child .amount-option__label,
.frequency-option:last-child .frequency-option__label,
.payment-option:last-child .payment-option__label {
    border-right: none;
}

/* Hover state (visual feedback) — subtle brighten relative to container */
.amount-option:hover .amount-option__label,
.frequency-option:hover .frequency-option__label,
.payment-option:hover .payment-option__label {
    background: color-mix(in srgb, var(--color-primary-500) 88%, var(--color-primary-100) 12%);
}

/* Checked/selected state — fills the segment with primary color */
.amount-option input:checked + .amount-option__label,
.frequency-option input:checked + .frequency-option__label,
.payment-option input:checked + .payment-option__label {
    background: var(--color-primary-300);
    color: var(--color-text-primary); /* keep original text color */
    border-right: 1px solid var(--color-primary-700);
}

/* Helper: allow using .options-surface on containers that were built with .input-group__inner
   If you add .options-surface to an element, the group becomes a visually neutral container
   and the label segments are the visual controls. */
.input-group__inner.options-surface {
    padding: 0; /* remove inner padding */
    background: transparent; /* visual surface is provided by the segmented container */
    border: 0;
}

/* ================================
   Custom amount (hidden by default)
================================= */

/* Hide custom amount by default */
.custom-amount-wrapper {
    display: none;
}

/* Optionally, smooth transition */
.custom-amount-wrapper.show {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 520px) {
    .amounts-grid {
        grid-auto-flow: row;
    }

    .amount-option__label {
        padding: 10px 8px;
        font-size: 0.95rem;
    }
}
