﻿/* =========================================================
   YWCA Donation Page – Clean CSS (single source of truth)
   ========================================================= */

/* --- Theme tokens --- */
:root {
    --magenta: #cf3679;
    --magenta-dark: #b82e69;
    --chip-border: #111;
    --muted: #6b7280;
    --text: #000;
}
#paynowDonate img {
    vertical-align: middle;
}
/* Utility */
.is-busy {
    opacity: .7;
    pointer-events: none;
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text);
}

/* Layout */
.container.donation-layout {
    max-width: 1100px;
    padding-top: 18px;
    padding-bottom: 36px;
}

/* Readonly inputs */
input[readonly].locked {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* Spacing helpers */
.mb-12 {
    margin-bottom: 12px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mt-24 {
    margin-top: 24px;
}

.mt-32 {
    margin-top: 32px;
}

.gx-5 {
    --bs-gutter-x: 3rem;
}

/* =========================
   Tabs (One-time / Monthly)
   ========================= */
.donation-tabs {
    display: flex;
    gap: 0;
    background: #cfd3dc;
    border-radius: 16px;
    padding: 4px;
}

    .donation-tabs .tab-btn {
        border: 0;
        background: transparent;
        padding: 12px 14px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 700;
        color: #333;
        width: 50%;
        cursor: pointer;
    }

        .donation-tabs .tab-btn.active-tab {
            background: var(--magenta) !important;
            color: #fff !important;
        }

/* Section titles */
.section-title {
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    margin: 16px 0 8px;
}

/* ====================================
   AMOUNT CHIPS – single row, scrollable
   ====================================

   • Always one row (nowrap)
   • With 2–4 chips: they stretch and fill the row equally
   • With many chips: maintain a min width and allow horizontal scroll
*/
/* === AMOUNT ROW — single chip row; "Other amount" always below === */
.container.donation-layout .amount-row {
    display: grid !important;
    grid-auto-flow: column !important; /* lay chips left→right in one row */
    grid-auto-columns: 1fr !important; /* equal widths across the row */
    gap: 16px !important;
    align-items: stretch !important;
    overflow: visible !important; /* no horizontal scroll bar */
}

/* Chips: stay on the FIRST row */
.container.donation-layout .amount-chip,
.container.donation-layout .donation-option {
    grid-row: 1 !important;
    min-width: 120px; /* optional guard */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* "Other amount": force SECOND row, span full width */
#onetime-other-container,
#monthly-other-container {
    grid-row: 2 !important; /* always below the chips */
    grid-column: 1 / -1 !important; /* span the full width */
    display: grid !important;
    grid-template-columns: auto minmax(180px, 280px) !important; /* label | input */
    justify-content: start !important;
    align-items: center !important;
    column-gap: 12px !important;
    margin-top: 6px;
}

/* Label + pill styles (keep your look) */
.container.donation-layout .other-label {
    font-size: 12px;
    margin: 0;
    text-align: left;
}

.container.donation-layout .other-pill {
    display: flex;
    align-items: center;
    border: 1px solid var(--chip-border);
    border-radius: 12px;
    padding: 0 10px;
    height: 40px;
}

.container.donation-layout .other-input {
    border: 0;
    outline: none;
    width: 100%;
    text-align: center;
    font-size: 12px;
    background: transparent;
}

/* Active chip = brand magenta (keeps your existing styles) */
.container.donation-layout .amount-row .donation-option.active,
.container.donation-layout .amount-row .donation-option.active:hover,
.container.donation-layout .amount-row .donation-option.active:focus {
    background: var(--magenta) !important;
    border-color: var(--magenta) !important;
    color: #fff !important;
    box-shadow: none !important;
}


/* “Other amount” row (always below the chips, full width) */
#onetime-other-container,
#monthly-other-container {
    flex-basis: 100%; /* move to a new line under the row */
    display: grid;
    grid-template-columns: auto minmax(180px, 280px); /* label | input pill */
    align-items: center;
    column-gap: 12px;
    margin-top: 6px;
}

.other-label {
    font-size: 12px;
    margin: 0;
    text-align: left;
}

.other-pill {
    display: flex;
    align-items: center;
    border: 1px solid var(--chip-border);
    border-radius: 12px;
    padding: 0 10px;
    height: 40px;
}

.other-input {
    border: 0;
    outline: none;
    width: 100%;
    text-align: center;
    font-size: 12px;
    background: transparent;
}

.small-err {
    font-size: 12px;
}

/* =================
   Campaigns section
   ================= */
.campaign-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* default 3 per row */
    gap: 10px;
}

    .campaign-grid.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .campaign-grid.cols-1 {
        grid-template-columns: 1fr;
    }

.btn-magenta,
.btn-outline-pill {
    display: inline-block;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 12px;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: .2s ease;
}

.btn-magenta {
    background: var(--magenta);
    color: #fff;
    border: 0;
}

    .btn-magenta:hover {
        background: var(--magenta-dark);
    }

.btn-outline-pill {
    background: #fff;
    border: 1px solid #111;
}

    .btn-outline-pill.active, .campaign-button.active {
        outline: 3px solid var(--magenta);
    }

/* Donor type */
.donor-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 8px;
}

    .donor-type-grid .dt-btn {
        border: 1px solid #111;
        border-radius: 12px;
        background: #fff;
        color: #000;
        padding: 10px 14px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        width: 100%;
    }

        .donor-type-grid .dt-btn.active-tab {
            background: var(--magenta);
            color: #fff;
            border-color: var(--magenta);
        }

/* Inputs tidy */
.clean-input {
    border-radius: 10px;
}

/* Checklines */
.checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    font-size: 12px;
}

    .checkline input {
        width: 16px;
        height: 16px;
    }

/* Right side imagery */
.campaign-hero {
    max-height: 500px;
    border-radius: 10px;
    transition: opacity .25s ease;
}

.collage {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 8px;
}

.campaign-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

/* Visibility helper */
.hidden {
    display: none;
}

/* Required star helper */
.required-star::after {
    content: " *";
    color: var(--magenta);
    font-weight: 700;
}

/* ======================
   Responsive adjustments
   ====================== */
@media (max-width: 992px) {
    .container.donation-layout {
        padding: 0 16px;
        max-width: 100%;
    }

    .donation-tabs .tab-btn {
        font-size: 12px;
        padding: 10px 12px;
    }
    /* Other amount pill full width on tablets/phones */
    #onetime-other-container, #monthly-other-container {
        grid-template-columns: 1fr; /* label on its own line */
        row-gap: 6px;
    }

    .other-label {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .campaign-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .donor-type-grid {
        grid-template-columns: 1fr;
    }

    #items_individual .row, #items_organization .row {
        row-gap: 6px;
    }

    #items_individual .form-group, #items_organization .form-group {
        margin-bottom: 6px;
    }

    .campaign-hero {
        max-height: 260px;
    }
}

@media (max-width: 480px) {
    .campaign-grid {
        grid-template-columns: 1fr;
    }

    .container.donation-layout .donation-option {
        font-size: 12px;
        padding: 6px 12px;
    }
}
/* === Amount chips: same look as other pill buttons === */
.container.donation-layout .amount-row .donation-option,
.container.donation-layout .amount-row .amount-chip {
    /* reset any Bootstrap outline styles */
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #d0d0d0 !important; /* soft gray like other buttons */
    border-radius: 9999px !important; /* pill */
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 18px !important;
    line-height: 1 !important;
    box-shadow: none !important;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

    .container.donation-layout .amount-row .donation-option:hover {
        border-color: #bdbdbd !important;
    }

    /* Selected chip = brand magenta */
    .container.donation-layout .amount-row .donation-option.active,
    .container.donation-layout .amount-row .donation-option.active:hover,
    .container.donation-layout .amount-row .donation-option.active:focus {
        background: var(--magenta) !important;
        border-color: var(--magenta) !important;
        color: #fff !important;
        box-shadow: none !important;
    }

/* “Other amount” pill: match the chip style */
.container.donation-layout .other-pill {
    border: 1px solid #d0d0d0 !important;
    background: #fff !important;
    border-radius: 9999px !important;
    height: 44px !important;
    padding: 0 14px !important;
    display: flex !important;
    align-items: center !important;
}

.container.donation-layout .other-input {
    background: transparent !important;
    border: 0 !important;
    outline: none !important;
    width: 100% !important;
    text-align: center !important;
    font-size: 12px !important;
}
/* ===== 1) Smaller labels + amount text ===== */
.container.donation-layout label,
.container.donation-layout .form-label {
    font-size: 12px !important; /* was larger */
    line-height: 1.2 !important;
    font-weight: 600; /* keep a little emphasis */
}

/* Amount numbers on the chips (and their inner text) */
.container.donation-layout .amount-row .donation-option,
.container.donation-layout .amount-row .amount-chip {
    font-size: 14px !important; /* smaller than before */
}

/* "Other amount" label + input text */
.container.donation-layout .other-label {
    font-size: 12px !important;
}

.container.donation-layout .other-input {
    font-size: 12px !important;
}

/* ===== 2) Campaign & Donor-type buttons — light border, pink when active ===== */

/* Default (unselected) look */
.container.donation-layout .campaign-button,
.container.donation-layout .donor-type-grid .dt-btn,
#individualBtn, #organizationBtn, #anonymousBtn {
    border: 1px solid #d0d0d0 !important; /* lighter border */
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
}

    /* Hover: subtle */
    .container.donation-layout .campaign-button:hover,
    .container.donation-layout .donor-type-grid .dt-btn:hover {
        border-color: #bfbfbf !important;
    }

    /* Selected/active = YWCA magenta */
    .container.donation-layout .campaign-button.active,
    .container.donation-layout .donor-type-grid .dt-btn.active,
    .container.donation-layout .donor-type-grid .dt-btn.active-tab,
    #individualBtn.active, #organizationBtn.active, #anonymousBtn.active,
    #individualBtn.active-tab, #organizationBtn.active-tab, #anonymousBtn.active-tab {
        background: var(--magenta) !important;
        border-color: var(--magenta) !important;
        color: #fff !important;
    }
/* Amount chip text – make smaller everywhere */
.container.donation-layout .amount-row .donation-option,
.container.donation-layout .amount-row .amount-chip,
.container.donation-layout .amount-row .donation-option *,
.container.donation-layout .amount-row .amount-chip * {
    font-size: 12px !important;
    line-height: 1 !important;
}
/* All form labels on this page */
.container.donation-layout label,
.container.donation-layout .form-label {
    font-size: 12px !important;
    font-weight: 400 !important; /* normal, not bold */
}
/* Color for “dynamic” star (NRIC/FIN uses this class) */
.container.donation-layout .required-star::after {
    content: " *";
    color: #e11d48 !important; /* red */
    font-weight: 700;
}

/* Color for “wrapped” literal stars */
.container.donation-layout .req-star {
    color: #e11d48 !important;
    font-weight: 700;
}
/* === Amount chips: equal width + "Other amount" on its own row === */
.container.donation-layout .amount-row {
    display: flex !important;
    align-items: stretch !important;
    gap: 16px !important;
    flex-wrap: wrap !important; /* allows us to push "Other amount" to next line */
    width: 100% !important;
}

    .container.donation-layout .amount-row .donation-option,
    .container.donation-layout .amount-row .amount-chip {
        flex: 1 1 0 !important; /* <-- equal widths */
        min-width: 0 !important; /* allow shrinking evenly */
        width: auto !important;
        order: 1 !important; /* chips stay on the first row */
    }

/* Force "Other amount" onto the second row, full width */
#onetime-other-container,
#monthly-other-container {
    order: 2 !important; /* comes after the chips */
    flex-basis: 100% !important; /* takes the whole next line */
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}
