@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bkash: #e2136e;
    --nagad: #f7941d;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(226, 19, 110, 0.1) 0px, transparent 50%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
}

.payment-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.method-option {
    position: relative;
    cursor: pointer;
}

.method-option input {
    position: absolute;
    opacity: 0;
}

.method-box {
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.02);
}

.method-option input:checked + .method-box {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.method-box img {
    height: 40px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.method-name {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper span {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 600;
}

.input-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1rem 1rem 2.5rem;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    transition: all 0.3s;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.quick-amounts {
    margin-top: 0.85rem;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
}

.amount-chip {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-radius: 10px;
    padding: 0.55rem 0.3rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-chip:hover {
    border-color: rgba(99, 102, 241, 0.55);
    background: rgba(99, 102, 241, 0.15);
}

.amount-chip.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.9);
    color: #fff;
}

.pay-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1.125rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.pay-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
}

.pay-button:active {
    transform: translateY(0);
}

.pay-button svg {
    width: 20px;
    height: 20px;
}

.footer-text {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-text span {
    color: #10b981;
    font-weight: 600;
}

/* Custom styles for bKash/Nagad selection */
.method-option.bkash input:checked + .method-box {
    border-color: var(--bkash);
    background: rgba(226, 19, 110, 0.1);
}
.method-option.nagad input:checked + .method-box {
    border-color: var(--nagad);
    background: rgba(247, 148, 29, 0.1);
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

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

/* Support Section */
.support-section {
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.support-section p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.telegram-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(0, 136, 204, 0.1);
    border: 1px solid rgba(0, 136, 204, 0.2);
    color: #0088cc;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.telegram-btn svg {
    width: 20px;
    height: 20px;
}

.telegram-btn:hover {
    background: #0088cc;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 136, 204, 0.3);
}

/* Inline Checkout */
.checkout-inline {
    margin-top: 1.25rem;
    background: rgba(17, 20, 29, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.checkout-inline.error {
    padding: 1rem;
    color: #fca5a5;
    text-align: center;
}

.checkout-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkout-header h3 {
    margin: 0;
    font-size: 1rem;
}

.close-inline-btn {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.84rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.32rem 0.62rem;
    transition: all 0.2s ease;
}

.close-inline-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.checkout-frame-wrap {
    position: relative;
    width: 100%;
    min-height: 520px;
    background: #fff;
}

.checkout-frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    min-height: 520px;
}

.checkout-help {
    padding: 0.85rem 1rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.checkout-help a {
    color: #93c5fd;
    text-decoration: underline;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .payment-card {
        padding: 1.5rem;
    }

    .quick-amounts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .checkout-frame-wrap {
        min-height: 460px;
    }
}
