/* =========================================================
   FLARE U GLOBAL
   COMEBACK FUNDING
========================================================= */

:root {
    --funding-bg: #f5faf9;
    --funding-card: #ffffff;

    --theme: #91d3ca;
    --theme-dark: #5db7ab;
    --theme-soft: #e7eeee;

    --text: #263b40;
    --muted: #718083;
    --border: #e3ebeb;

    --radius-lg: 22px;
    --radius-md: 15px;

    --title: 22px;
}


/* =========================================================
   BASE
========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;

    background: var(--funding-bg);
    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}


/* =========================================================
   FUNDING PAGE
========================================================= */

#funding {
    margin-top: 0 !important;
    padding: 0 !important;
}

.page.funding-page {
    width: 100%;
    max-width: 768px;

    margin: 0 auto;

    padding-top: 0;
}


/* =========================================================
   GLOBAL CONTENT
========================================================= */

#funding .global-content {
    width: 100%;

    margin-bottom: 16px !important;

    padding: 16px !important;

    background: var(--funding-bg);
}


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

.page.funding-page .funding-sticky {
    position: sticky;

    top: 0;

    z-index: 1000;

    width: 100%;

    background: #fff;
}


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

.page.funding-page .funding-title {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 12px 16px 0;
}

.page.funding-page .funding-title h2 {
    margin: 0;
    padding: 0;

    color: #111;

    font-size: var(--title);
    font-weight: 700;

    line-height: 1.2;
}


/* =========================================================
   HOME BUTTON
========================================================= */

.page.funding-page .funding-title-home {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 25px;
    height: 25px;

    flex: 0 0 auto;

    text-decoration: none;

    -webkit-tap-highlight-color: transparent;
}

.page.funding-page .funding-title-home img {
    display: block;

    width: 25px;
    height: 25px;

    object-fit: contain;
}


/* =========================================================
   FUNDING METHOD TABS
========================================================= */

.funding-method-tabs {
    position: relative;

    display: flex;
    align-items: stretch;

    width: 100%;

    padding: 10px 16px 0;

    background: #fff;

    overflow-x: auto;

    scrollbar-width: none;

    border-bottom: 1px solid #edf1f1;
}

.funding-method-tabs::-webkit-scrollbar {
    display: none;
}


/* =========================================================
   TAB BUTTON
========================================================= */

.funding-method-filter {
    position: relative;

    flex: 1 1 0;

    min-width: 0;

    height: 40px;

    margin: 0;
    padding: 0 12px;

    border: none;

    outline: none;

    background: transparent;

    color: var(--muted);

    font-family: inherit;

    font-size: 13px;
    font-weight: 600;

    line-height: 40px;

    text-align: center;

    white-space: nowrap;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;

    transition:
        color 0.2s ease;
}

.funding-method-filter:focus-visible {
    outline: 2px solid var(--theme);
    outline-offset: -2px;
}

.funding-method-filter.active {
    color: var(--theme-dark);
}


/* =========================================================
   ACTIVE TAB LINE
========================================================= */

.funding-method-filter.active::after {
    content: "";

    position: absolute;

    left: 12px;
    right: 12px;

    bottom: 0;

    height: 2px;

    background: var(--theme-dark);

    border-radius: 999px;
}


/* =========================================================
   FUNDING CONTENT
========================================================= */

.funding-content {
    width: 100%;
}

.funding-content[hidden] {
    display: none !important;
}


/* =========================================================
   TYPOGRAPHY
========================================================= */

.eyebrow,
.campaign-label,
.section-kicker {
    margin: 0 0 5px;

    color: var(--theme-dark);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.08em;
}

.funding-header h1 {
    margin: 0;

    font-size: 20px;
    line-height: 1.2;
}

#fundingTarget,
#fundingTargetKofi,
#fundingTargetEwallet {
    font-size: 18px;
    font-weight: 600;
}


/* =========================================================
   CARD
========================================================= */

.funding-card {
    padding: 22px;

    background: var(--funding-card);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    box-shadow:
        0 5px 20px rgba(
            38,
            59,
            64,
            0.045
        );
}


/* =========================================================
   CAMPAIGN
========================================================= */

.campaign-card {
    margin-bottom: 28px;
}

.campaign-card h2 {
    margin: 8px 0 10px;

    font-size: 25px;
    line-height: 1.25;
}

.campaign-description {
    margin: 0 0 25px;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.65;
}


/* =========================================================
   KO-FI EMBED
========================================================= */

.kofi-embed {
    width: 100%;

    margin-top: 20px;

    overflow: hidden;
}

.kofi-embed iframe {
    display: block;

    width: 100%;
    max-width: 100%;

    border: 0;
}


/* =========================================================
   PROGRESS
========================================================= */

.funding-progress {
    margin-bottom: 22px;
}

.progress-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 9px;
}

.progress-heading > div {
    display: flex;
    align-items: baseline;

    flex-wrap: wrap;

    gap: 4px;

    min-width: 0;
}

.progress-label {
    width: 100%;

    color: var(--muted);

    font-size: 11px;
}

.progress-heading strong {
    font-size: 17px;
}

.progress-track {
    width: 100%;
    height: 10px;

    overflow: hidden;

    border-radius: 999px;

    background: var(--theme-soft);
}

.progress-fill {
    width: 0;
    height: 100%;

    border-radius: inherit;

    background: var(--theme-dark);

    transition:
        width 0.4s ease;
}

.progress-note,
.small-note,
.transparency-note {
    margin: 9px 0 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.5;
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-btn,
.secondary-btn {
    width: 100%;

    min-height: 46px;

    border-radius: 13px;

    font-weight: 700;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

.primary-btn {
    border: 0;

    background: var(--theme-dark);

    color: #fff;
}

.secondary-btn {
    border: 1px solid var(--border);

    background: #fff;

    color: var(--text);
}

.primary-btn:active,
.secondary-btn:active,
.back-btn:active {
    transform: scale(0.98);
}

.primary-btn:disabled {
    opacity: 0.55;

    cursor: not-allowed;
}


/* =========================================================
   SUPPORT FORM
========================================================= */

.support-form-card {
    margin-top: -10px;
    margin-bottom: 28px;

    animation:
        formOpen 0.25s ease;
}

@keyframes formOpen {

    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


/* =========================================================
   SECTION HEADING
========================================================= */

.section-heading {
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 4px 0 7px;

    font-size: 21px;
    line-height: 1.3;
}

.section-heading p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.55;
}


/* =========================================================
   FORM
========================================================= */

.form-group {
    position: relative;

    margin-bottom: 18px;
}

.form-group > label,
.form-label {
    display: block;

    margin-bottom: 7px;

    font-size: 12px;
    font-weight: 700;
}

.optional {
    color: var(--muted);

    font-weight: 400;
}


/* =========================================================
   FORM INPUTS
========================================================= */

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: #fbfdfd;

    color: var(--text);

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    height: 45px;

    padding: 0 13px;
}

.form-group textarea {
    min-height: 80px;

    padding: 11px 13px;

    resize: vertical;

    line-height: 1.5;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
    border-color: var(--theme);

    box-shadow:
        0 0 0 3px rgba(
            145,
            211,
            202,
            0.15
        );
}


/* =========================================================
   AMOUNT
========================================================= */

#supportAmount {
    appearance: textfield;
}

#supportAmount::-webkit-outer-spin-button,
#supportAmount::-webkit-inner-spin-button {
    margin: 0;

    appearance: none;
}


/* =========================================================
   CUSTOM DROPDOWN WRAPPERS
========================================================= */

.payment-method-dropdown,
.currency-dropdown,
.sort-filter {
    position: relative;
}


/* =========================================================
   PAYMENT METHOD TRIGGER
========================================================= */

.payment-method-trigger,
.currency-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    min-height: 45px;

    padding: 10px 14px;

    border: 1px solid var(--border);

    border-radius: 14px;

    background: #fff;

    color: #555;

    font-size: 14px;
    font-weight: 500;

    text-align: left;

    outline: none;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.payment-method-trigger:hover,
.currency-trigger:hover {
    background: #fcfefe;
}

.payment-method-trigger:focus-visible,
.currency-trigger:focus-visible {
    border-color: var(--theme);

    box-shadow:
        0 0 0 3px rgba(
            145,
            211,
            202,
            0.15
        );
}


/* =========================================================
   DROPDOWN ARROW
========================================================= */

.dropdown-arrow {
    flex-shrink: 0;

    margin-left: 10px;

    transition:
        transform 0.2s ease;
}

.payment-method-dropdown.active
.dropdown-arrow,
.currency-dropdown.active
.dropdown-arrow,
.sort-filter.active
.dropdown-arrow {
    transform: rotate(180deg);
}


/* =========================================================
   PAYMENT METHOD MENU
========================================================= */

.payment-method-menu,
.currency-menu {
    position: absolute;

    top: calc(100% + 8px);
    left: 0;

    z-index: 9999;

    display: none;

    width: 100%;
    min-width: 190px;

    padding: 8px;

    border: 1px solid rgba(
        255,
        255,
        255,
        0.8
    );

    border-radius: 18px;

    background: rgba(
        255,
        255,
        255,
        0.96
    );

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    box-shadow:
        0 12px 30px rgba(
            0,
            0,
            0,
            0.12
        );
}

.payment-method-menu.active,
.currency-menu.active {
    display: block;
}


/* =========================================================
   PAYMENT / CURRENCY OPTIONS
========================================================= */

.payment-method-option,
.currency-option {
    display: flex;
    align-items: center;

    width: 100%;

    padding: 12px 14px;

    margin: 2px 0;

    border: 0;

    border-radius: 10px;

    background: transparent;

    color: #555;

    font-size: 14px;
    font-weight: 500;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.payment-method-option:hover,
.currency-option:hover {
    background: rgba(
        0,
        0,
        0,
        0.05
    );
}

.payment-method-option.active,
.currency-option.active {
    background: rgba(
        0,
        0,
        0,
        0.06
    );

    color: #111;

    font-weight: 600;
}


/* =========================================================
   SORT FILTER
========================================================= */

.sort-filter {
    position: relative;

    z-index: 100;
}


/* =========================================================
   SORT TRIGGER
========================================================= */

.sort-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: auto;
    min-width: 150px;
    min-height: 38px;

    padding: 8px 12px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: #fff;

    color: #555;

    font-size: 13px;
    font-weight: 500;

    text-align: left;

    outline: none;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.sort-trigger:hover {
    background: #fcfefe;
}


/* =========================================================
   SORT MENU
========================================================= */

.sort-dropdown {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;
    left: auto;

    z-index: 9999;

    display: none;

    width: max-content;
    min-width: 190px;
    max-width: 240px;

    padding: 8px;

    border: 1px solid rgba(
        255,
        255,
        255,
        0.8
    );

    border-radius: 18px;

    background: rgba(
        255,
        255,
        255,
        0.96
    );

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    box-shadow:
        0 12px 30px rgba(
            0,
            0,
            0,
            0.12
        );
}

.sort-dropdown.active {
    display: block;
}


/* =========================================================
   SORT OPTIONS
========================================================= */

.sort-option {
    display: flex;
    align-items: center;

    width: 100%;

    padding: 12px 14px;

    margin: 2px 0;

    border: 0;

    border-radius: 10px;

    background: transparent;

    color: #555;

    font-size: 14px;
    font-weight: 500;

    text-align: left;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.sort-option:hover {
    background: rgba(
        0,
        0,
        0,
        0.05
    );
}

.sort-option.active {
    background: rgba(
        0,
        0,
        0,
        0.06
    );

    color: #111;

    font-weight: 600;
}


/* =========================================================
   PAYMENT DESTINATION
========================================================= */

.payment-destination {
    position: relative;

    margin: -5px 0 18px;

    padding: 13px;

    border: 1px solid var(--border);

    border-radius: 13px;

    background: var(--funding-bg);
}

.payment-method-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 9px;
}

.payment-method-logo img {
    display: block;
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
}

#destinationContent {
    padding-right: 55px;
    font-size: 13px;
    font-weight: 600;
    word-break: break-word;
}

#copyPaymentBtn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 5px 8px;
    border: 0;

    border-radius: 7px;

    background: #fff;

    color: var(--theme-dark);

    font-size: 11px;
    font-weight: 700;
}


/* =========================================================
   UPLOAD
========================================================= */

.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 110px;

    padding: 15px;

    border: 1.5px dashed #cbdada;

    border-radius: 14px;

    background: #fbfdfd;

    text-align: center;

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.upload-box:hover {
    border-color: var(--theme);

    background: var(--funding-bg);
}

.upload-icon {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    margin-bottom: 7px;

    border-radius: 50%;

    background: var(--theme-soft);

    font-size: 18px;
}

.upload-box span:not(.upload-icon) {
    max-width: 100%;

    overflow: hidden;

    font-size: 13px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-box small {
    margin-top: 4px;

    color: var(--muted);

    font-size: 10px;
}


/* =========================================================
   NOTE
========================================================= */

.character-count {
    position: absolute;

    right: 10px;
    bottom: 29px;

    color: var(--muted);

    font-size: 9px;
}

.field-note {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 10px;
}


/* =========================================================
   RADIO
========================================================= */

.radio-option {
    display: flex !important;
    align-items: center;

    gap: 9px;

    margin-bottom: 9px !important;

    font-weight: 500 !important;
}

.radio-option input {
    accent-color: var(--theme-dark);
}


/* =========================================================
   SUBMIT
========================================================= */

.submit-btn {
    margin-top: 4px;
}

#cancelSupport {
    margin-top: 9px;
}


/* =========================================================
   SUCCESS
========================================================= */

.form-success {
    padding: 20px 0 5px;

    text-align: center;
}

.success-icon {
    display: grid;
    place-items: center;

    width: 50px;
    height: 50px;

    margin: 0 auto 13px;

    border-radius: 50%;

    background: var(--theme-soft);

    color: var(--theme-dark);

    font-size: 23px;
    font-weight: 700;
}

.form-success h3 {
    margin: 0 0 7px;

    font-size: 18px;
}

.form-success p {
    margin: 0 0 18px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.55;
}


/* =========================================================
   FUNDING GOALS
========================================================= */

.funding-section {
    margin-bottom: 30px;
}

.goal-list {
    display: flex;
    flex-direction: column;

    gap: 10px;
}


/* =========================================================
   GOAL ITEM
========================================================= */

.funding-goal {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 14px;

    border: 1px solid var(--border);

    border-radius: 15px;

    background: #fff;
}


/* =========================================================
   GOAL ICON
========================================================= */

.funding-goal-icon,
.goal-icon {
    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border-radius: 11px;

    background: var(--theme-soft);

    font-size: 17px;
}


/* =========================================================
   GOAL CONTENT
========================================================= */

.funding-goal-content,
.goal-content {
    flex: 1;

    min-width: 0;
}

.funding-goal-title {
    margin-bottom: 3px;

    font-size: 13px;
    font-weight: 700;
}

.funding-goal-description {
    color: var(--muted);

    font-size: 10px;
    line-height: 1.4;
}

.goal-content strong {
    display: block;

    margin-bottom: 3px;

    font-size: 13px;
}

.goal-content p {
    margin: 0;

    color: var(--muted);

    font-size: 10px;
    line-height: 1.4;
}


/* =========================================================
   GOAL AMOUNT
========================================================= */

.funding-goal-amount,
.goal-amount {
    flex-shrink: 0;

    font-size: 13px;
    font-weight: 700;

    text-align: right;
}


/* =========================================================
   DATA STATES
========================================================= */

.funding-loading,
.funding-error,
.funding-empty,
.data-loading,
.data-error,
.empty-state {
    padding: 25px 0;

    color: var(--muted);

    font-size: 12px;

    text-align: center;
}

.funding-error,
.data-error {
    color: #a66;
}


/* =========================================================
   TRANSPARENCY
========================================================= */

.transparency-card {
    margin-top: 10px;
}


/* =========================================================
   CURRENCY SUMMARY
========================================================= */

.currency-summary {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(
                0,
                1fr
            )
        );

    gap: 8px;

    margin-bottom: 18px;
}

.currency-summary-item,
.currency-total {
    display: block;

    padding: 12px;

    border-radius: 13px;

    background: var(--funding-bg);

    color: var(--text);

    font-size: 12px;
    font-weight: 600;
}

.currency-total span {
    display: block;

    margin-bottom: 4px;

    color: var(--muted);

    font-size: 10px;
}

.currency-total strong {
    font-size: 14px;
}


/* =========================================================
   TRANSPARENCY TOOLBAR
========================================================= */

.transparency-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 10px;
}

.transparency-toolbar > span {
    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   TRANSACTIONS
========================================================= */

.transaction-list {
    display: flex;
    flex-direction: column;
}

.funding-transaction,
.transaction-item {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding: 13px 0;

    border-bottom: 1px solid var(--border);
}

.funding-transaction:last-child,
.transaction-item:last-child {
    border-bottom: 0;
}

.funding-transaction-main,
.transaction-main {
    flex: 1;

    min-width: 0;
}

.funding-transaction-name,
.transaction-name {
    margin: 0 0 3px;

    overflow: hidden;

    font-size: 13px;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.funding-transaction-date,
.transaction-date {
    color: var(--muted);

    font-size: 10px;
}

.funding-transaction-note,
.transaction-message {
    margin: 8px 0 0;

    padding: 8px 10px;

    border-radius: 9px;

    background: var(--funding-bg);

    color: var(--text);

    font-size: 11px;
    line-height: 1.45;

    word-break: break-word;
}

.funding-transaction-amount,
.transaction-amount {
    flex-shrink: 0;

    margin-left: auto;

    font-size: 13px;
    font-weight: 700;

    text-align: right;
}


/* =========================================================
   FUNDING NOTE / FOOTER
========================================================= */

.funding-note {
    padding: 20px 5px;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.5;

    text-align: center;
}

.funding-note p {
    margin: 0 0 5px;
}

.funding-note p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   FUNDING CLOSED
========================================================= */

.funding-closed {
    min-height: calc(100vh - 80px);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 60px 24px;

    text-align: center;
}

.funding-closed-icon {
    display: grid;
    place-items: center;

    width: 58px;
    height: 58px;

    margin-bottom: 18px;

    border-radius: 50%;

    background: var(--theme-soft);

    color: var(--theme-dark);

    font-size: 25px;
}

.funding-closed .section-kicker {
    margin-bottom: 7px;
}

.funding-closed h2 {
    max-width: 420px;

    margin: 0 0 10px;

    color: var(--text);

    font-size: 22px;
    line-height: 1.3;
}

.funding-closed p {
    max-width: 460px;

    margin: 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .funding-page {
        padding-top: 0;
    }

    #funding .global-content {
        padding: 16px !important;
    }

    .funding-card {
        padding: 18px;
    }

    .campaign-card h2 {
        font-size: 22px;
    }

    .funding-goal {
        gap: 10px;

        padding: 12px;
    }

    .funding-goal-icon,
    .goal-icon {
        width: 36px;
        height: 36px;
    }

    .funding-goal-title {
        font-size: 12px;
    }

    .funding-goal-amount,
    .goal-amount {
        font-size: 12px;
    }

    .sort-trigger {
        min-width: 135px;

        font-size: 12px;
    }

    .transparency-toolbar {
        align-items: flex-start;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .funding-method-tabs {
        padding-left: 12px;
        padding-right: 12px;
    }

    .funding-method-filter {
        padding-left: 8px;
        padding-right: 8px;
    }

    .funding-method-filter.active::after {
        left: 8px;
        right: 8px;
    }

    .transparency-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-filter,
    .sort-trigger {
        width: 100%;
    }

    .sort-trigger {
        min-width: 0;
    }

    .sort-dropdown {
        left: 0;
        right: 0;

        width: 100%;
        max-width: none;
    }

    .progress-heading {
        gap: 8px;
    }

    .funding-goal-amount,
    .goal-amount {
        font-size: 11px;
    }

}