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

:root {
    --stripe-blue: #635bff;
    --stripe-dark: #0a2540;
    --stripe-gray: #6c757d;
    --stripe-light-gray: #f6f9fc;
    --stripe-border: #e0e6ed;
    --stripe-text: #0a2540;
    --stripe-text-light: #6c757d;
    --stripe-error: #df1b41;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    /* Градиент такой же как на главной странице */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    background-size: cover;
}

/* Логотипы платёжных систем */
.payment-logos {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--stripe-border);
}

.payment-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
}

.payment-logo {
    height: 28px;
    width: auto;
    opacity: 1;
    transition: opacity 0.3s ease;
    display: block;
}

.payment-logo:hover {
    opacity: 0.85;
}

.visa-logo {
    height: 28px;
    width: auto;
}

.mastercard-logo {
    height: 28px;
    width: auto;
}

.paypal-logo {
    height: 28px;
    width: auto;
}


.payment-container {
    width: 100%;
    max-width: 600px;
    padding: 12px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 24px);
}

.payment-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.payment-header {
    padding: 20px 24px 16px;
    text-align: left;
    border-bottom: 1px solid var(--stripe-border);
    flex-shrink: 0;
}

.payment-header h1 {
    color: var(--stripe-text);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0;
    letter-spacing: -0.3px;
    line-height: 1.4;
}

.amount-display {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 12px;
}

.amount-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--stripe-text);
    line-height: 1;
    letter-spacing: -1px;
}

.amount-currency {
    font-size: 18px;
    font-weight: 500;
    color: var(--stripe-text-light);
    margin-left: 4px;
}

.payment-form {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.payment-form::-webkit-scrollbar {
    width: 6px;
}

.payment-form::-webkit-scrollbar-track {
    background: transparent;
}

.payment-form::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.payment-form::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--stripe-text);
    letter-spacing: 0;
    line-height: 1.4;
    margin-bottom: 4px;
    display: block;
}

.label-hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--stripe-text-light);
    margin-left: 4px;
}

.form-group input {
    padding: 9px 14px;
    border: 1px solid var(--stripe-border);
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    color: var(--stripe-text);
    background: #ffffff;
    transition: all 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.5;
}

.form-group input:hover {
    border-color: #cbd5e0;
}

.form-group input:focus {
    outline: none;
    border-color: var(--stripe-blue);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

.form-group input:disabled,
.form-group input[readonly] {
    background: var(--stripe-light-gray);
    cursor: not-allowed;
    color: var(--stripe-text-light);
    border-color: var(--stripe-border);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-group select {
    padding: 9px 14px;
    border: 1px solid var(--stripe-border);
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    color: var(--stripe-text);
    background: #ffffff;
    transition: all 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.5;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
}

.form-group select:hover {
    border-color: #cbd5e0;
}

.form-group select:focus {
    outline: none;
    border-color: var(--stripe-blue);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

.form-group select:disabled {
    background: var(--stripe-light-gray);
    cursor: not-allowed;
    color: var(--stripe-text-light);
    border-color: var(--stripe-border);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: var(--stripe-error);
}

.address-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--stripe-border);
    padding-top: 16px;
    margin-top: 2px;
}

.address-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--stripe-text);
    margin-bottom: 12px;
    letter-spacing: 0;
}

.address-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.privacy-notice {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    padding: 10px;
    border-radius: 4px;
    margin-top: 12px;
    font-size: 11px;
    color: #0369a1;
    line-height: 1.4;
}

.privacy-icon {
    margin-right: 6px;
}

.btn-pay {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2px;
    letter-spacing: 0;
    width: 100%;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), 0 2px 8px rgba(118, 75, 162, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-pay::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-pay:hover {
    background: linear-gradient(135deg, #7a8ef5 0%, #8a5fb8 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5), 0 4px 12px rgba(118, 75, 162, 0.4);
    transform: translateY(-2px);
}

.btn-pay:hover::before {
    left: 100%;
}

.btn-pay:active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4), 0 1px 5px rgba(118, 75, 162, 0.3);
    transform: translateY(0);
}

.btn-pay:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #a0a0a0 0%, #808080 100%);
    box-shadow: none;
    transform: none;
}

.widget-header {
    padding: 32px 32px 24px;
    text-align: left;
    border-bottom: 1px solid var(--stripe-border);
}

.widget-header h2 {
    color: var(--stripe-text);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.widget-header p {
    color: var(--stripe-text-light);
    font-size: 14px;
}

.bxb-widget-container {
    margin: 0;
    min-height: 500px;
    background: #ffffff;
    border-radius: 0;
    padding: 32px;
}

.btn-cancel {
    background: #ffffff;
    color: var(--stripe-text);
    border: 1px solid var(--stripe-border);
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0 32px 32px;
    width: calc(100% - 64px);
    font-family: inherit;
}

.btn-cancel:hover {
    background: var(--stripe-light-gray);
    border-color: #cbd5e0;
}

.message {
    margin: 0 32px 20px;
    padding: 12px 16px;
    border-radius: 4px;
    text-align: left;
    font-size: 14px;
    display: none;
    line-height: 1.5;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    display: block;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}

.message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    display: block;
}

/* Десктоп - форма должна помещаться на экране */
@media (min-width: 601px) {
    body {
        padding: 8px;
        overflow-y: hidden;
    }
    
    .payment-container {
        max-width: 600px;
        max-height: calc(100vh - 16px);
    }
    
    .payment-logos {
        gap: 24px;
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .payment-logo {
        height: 36px;
    }
    
    .payment-header {
        padding: 16px 20px 12px;
        flex-shrink: 0;
    }
    
    .payment-header h1 {
        font-size: 17px;
    }
    
    .amount-value {
        font-size: 26px;
    }
    
    .payment-form {
        gap: 10px;
        padding: 16px 20px 20px;
    }
    
    .form-group {
        margin-bottom: 0;
    }
    
    .form-group label {
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    .form-group input,
    .form-group select {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .form-group select {
        padding-right: 34px;
        background-position: right 10px center;
    }
    
    .address-section {
        margin-top: 2px;
        padding-top: 14px;
    }
    
    .address-section-title {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .privacy-notice {
        font-size: 10px;
        padding: 8px;
        margin-top: 10px;
        line-height: 1.3;
    }
    
    .btn-pay {
        padding: 11px 20px;
        font-size: 14px;
        margin-top: 2px;
    }
}

/* Мобильная адаптация */
@media (max-width: 600px) {
    body {
        padding: 0;
        align-items: flex-start;
        background: #ffffff;
    }
    
    .payment-container {
        padding: 0;
        max-width: 100%;
    }
    
    .payment-card {
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
        max-height: none;
    }
    
    .payment-header {
        padding: 24px 20px 20px;
    }
    
    .payment-header h1 {
        font-size: 18px;
    }
    
    .amount-value {
        font-size: 28px;
    }
    
    .amount-currency {
        font-size: 16px;
    }
    
    .payment-form {
        padding: 24px 20px;
        gap: 20px;
    }
    
    .address-row {
        grid-template-columns: 1fr;
    }
    
    .form-group input,
    .form-group select {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .widget-header {
        padding: 24px 20px 20px;
    }
    
    .bxb-widget-container {
        padding: 24px 20px;
    }
    
    .btn-cancel {
        margin: 0 20px 24px;
        width: calc(100% - 40px);
    }
    
    .message {
        margin: 0 20px 20px;
    }
}
