/* ===========================================================
   FUND MODAL — Wesprzyj konkretny wyjazd
   =========================================================== */

.fund-modal {
    border: none;
    background: var(--bg-ink-deep);
    color: var(--paper);
    padding: 0;
    width: min(420px, calc(100vw - 32px));
    max-height: 92vh;
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(245, 241, 232, 0.08),
        0 32px 80px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    inset: 0;
    margin: auto;
}

.fund-modal::backdrop {
    background: rgba(7, 9, 12, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.fund-modal[open] {
    animation: fund-modal-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fund-modal-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.fund-modal__inner {
    display: grid;
    grid-template-rows: auto 1fr auto;
    max-height: 92vh;
    position: relative;
}

/* --- CLOSE --- */
.fund-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--paper-dim);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 160ms ease;
    z-index: 3;
}
.fund-modal__close:hover {
    color: var(--paper);
    transform: rotate(90deg);
}

/* --- HEAD --- */
.fund-modal__head {
    padding: 32px 28px 4px;
    text-align: left;
}

.fund-modal__title {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}
.fund-modal__title em {
    font-style: italic;
    color: var(--coral);
    font-weight: 600;
}

.fund-modal__sub {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--paper-dim);
    margin: 0;
}
.fund-modal__sub > span:first-child {
    color: var(--paper);
    font-weight: 700;
}
.fund-modal__sub-sep { margin: 0 6px; opacity: 0.4; }

/* --- BODY --- */
.fund-modal__body {
    padding: 24px 28px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: grid;
    gap: 14px;
}

/* Amount chips */
.fund-modal__amounts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.fund-modal__amount-chip {
    appearance: none;
    border: 1px solid rgba(245, 241, 232, 0.12);
    background: transparent;
    color: var(--paper);
    padding: 16px 4px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 160ms ease;
    line-height: 1;
}
.fund-modal__amount-chip:hover {
    border-color: rgba(245, 241, 232, 0.32);
    background: rgba(245, 241, 232, 0.04);
}
.fund-modal__amount-chip[aria-pressed="true"] {
    border-color: var(--coral);
    background: rgba(255, 78, 90, 0.12);
    color: var(--paper);
    box-shadow: 0 0 0 3px rgba(255, 78, 90, 0.18);
}

/* Custom amount */
.fund-modal__amount-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(245, 241, 232, 0.12);
    background: transparent;
    color: var(--paper);
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    box-sizing: border-box;
    text-align: center;
}
.fund-modal__amount-input::placeholder {
    color: var(--paper-dim);
    font-weight: 400;
    letter-spacing: 0.02em;
}
.fund-modal__amount-input:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(255, 78, 90, 0.15);
}
.fund-modal__amount-input::-webkit-outer-spin-button,
.fund-modal__amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.fund-modal__amount-input { -moz-appearance: textfield; }

/* BLIK group — wraps label + inputs in a subtle card */
.fund-modal__blik-group {
    margin-top: 6px;
    padding: 16px 14px 18px;
    border-radius: 12px;
    background: rgba(245, 241, 232, 0.025);
    border: 1px solid rgba(245, 241, 232, 0.08);
}

.fund-modal__blik-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.fund-modal__blik-badge {
    display: block;
    height: 24px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
}

.fund-modal__blik-label-text {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--paper-dim);
    line-height: 1.3;
}

.fund-modal__blik {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.fund-modal__blik-digit {
    width: 100%;
    max-width: 44px;
    aspect-ratio: 1;
    border: 1px solid rgba(245, 241, 232, 0.18);
    background: rgba(7, 9, 12, 0.6);
    color: var(--paper);
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    transition: all 160ms ease;
    padding: 0;
}
.fund-modal__blik-digit::placeholder {
    color: rgba(245, 241, 232, 0.22);
    font-weight: 400;
}
.fund-modal__blik-digit:focus {
    outline: none;
    border-color: #FA4F73;
    box-shadow: 0 0 0 3px rgba(250, 79, 115, 0.22);
    background: rgba(250, 79, 115, 0.06);
}
.fund-modal__blik-digit:not(:placeholder-shown) {
    border-color: rgba(250, 79, 115, 0.5);
    background: rgba(250, 79, 115, 0.04);
}

.fund-modal__blik-sep {
    width: 8px;
    height: 2px;
    background: rgba(245, 241, 232, 0.22);
    border-radius: 1px;
    flex-shrink: 0;
}

/* --- FOOT (sticky CTA) --- */
.fund-modal__foot {
    padding: 18px 28px 22px;
    background: var(--bg-ink-deep);
    position: sticky;
    bottom: 0;
}

.fund-modal__cta {
    appearance: none;
    width: 100%;
    background: var(--coral);
    color: var(--paper);
    border: none;
    padding: 16px 20px;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: all 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}
.fund-modal__cta:hover:not(:disabled) {
    background: var(--coral-deep);
    transform: translateY(-1px);
    box-shadow: 0 14px 36px var(--coral-glow);
}
.fund-modal__cta:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.fund-modal__cta-amount {
    font-family: var(--font-mono);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.22);
    padding: 5px 10px;
    border-radius: 6px;
    letter-spacing: 0;
}

.fund-modal__cta-alt {
    appearance: none;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(245, 241, 232, 0.16);
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 180ms ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.fund-modal__cta-alt:hover {
    border-color: rgba(245, 241, 232, 0.32);
    background: rgba(245, 241, 232, 0.03);
}

.fund-modal__cta-alt-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.fund-modal__cta-alt-arrow {
    color: var(--paper-dim);
    transition: transform 180ms ease;
}
.fund-modal__cta-alt:hover .fund-modal__cta-alt-arrow {
    transform: translateX(2px);
    color: var(--paper);
}

.fund-modal__cta-alt-icons {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Payment method icons */
.pay-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 20px;
    padding: 0 6px;
    background: #fff;
    border-radius: 4px;
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 900;
    font-size: 9px;
    letter-spacing: 0.02em;
    color: #1A1F71;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.pay-icon--visa {
    color: #1A1F71;
    letter-spacing: 0.04em;
    font-style: italic;
}

.pay-icon--mc {
    padding: 0 4px;
    gap: 0;
}
.pay-icon-mc-r,
.pay-icon-mc-y {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}
.pay-icon-mc-r {
    background: #EB001B;
    margin-right: -4px;
    position: relative;
    z-index: 1;
}
.pay-icon-mc-y {
    background: #F79E1B;
    mix-blend-mode: multiply;
}

.pay-icon--apple {
    color: #000;
    padding: 0 5px;
    gap: 2px;
}
.pay-icon--apple svg { display: block; }

.pay-icon--gpay {
    color: #5F6368;
    padding: 0 5px;
    gap: 3px;
}
.pay-icon--gpay svg { display: block; }

/* --- MOBILE — bottom sheet --- */
@media (max-width: 640px) {
    .fund-modal {
        width: 100vw;
        max-width: 100vw;
        max-height: 94vh;
        border-radius: 24px 24px 0 0;
        inset: auto 0 0 0;
        margin: 0;
    }

    .fund-modal[open] {
        animation: fund-modal-sheet 320ms cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes fund-modal-sheet {
        from { transform: translateY(100%); opacity: 0.5; }
        to   { transform: translateY(0); opacity: 1; }
    }

    .fund-modal__inner { max-height: 94vh; }
    .fund-modal__inner::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 38px;
        height: 4px;
        border-radius: 2px;
        background: rgba(245, 241, 232, 0.18);
    }

    .fund-modal__head { padding: 36px 22px 4px; }
    .fund-modal__body { padding: 20px 22px 8px; }
    .fund-modal__foot { padding: 14px 22px 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
    .fund-modal__title { font-size: 26px; }
    .fund-modal__blik-digit { font-size: 20px; }
    .fund-modal__close { top: 12px; right: 12px; }
}
