:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #f4f4f5;
    
    --primary-color: #2481cc;
    --success-color: #4caf50;
    --error-color: #f44336;
    --border-radius: 12px;
    --spacing: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing);
}

/* Loader */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--tg-theme-secondary-bg-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 24px;
}

.header .icon {
    font-size: 64px;
    margin-bottom: 12px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

/* Card */
.card {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing);
    overflow: hidden;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.card-header h2,
.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 16px;
}

.description {
    color: var(--tg-theme-hint-color);
    font-size: 15px;
}

/* Payment Types */
.payment-types {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-type-option {
    position: relative;
    cursor: pointer;
}

.payment-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--tg-theme-bg-color);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.payment-type-option input[type="radio"]:checked + .option-content {
    border-color: var(--primary-color);
    background: rgba(36, 129, 204, 0.05);
}

.option-icon {
    font-size: 32px;
}

.option-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.option-info p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    margin: 0;
}

/* Subscription Info */
.subscription-notice {
    display: flex;
    gap: 12px;
    background: rgba(36, 129, 204, 0.1);
}

.notice-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notice-content h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.notice-content p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    margin: 0;
}

/* Amount Display */
.amount-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
}

.currency {
    font-size: 32px;
    font-weight: 600;
    color: var(--tg-theme-hint-color);
}

.amount {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Payment Button */
.payment-button-container {
    margin: 24px 0;
}

.pay-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-theme-button-text-color);
    background: var(--tg-theme-button-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(36, 129, 204, 0.3);
}

.pay-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(36, 129, 204, 0.4);
}

.pay-button:active:not(:disabled) {
    transform: translateY(0);
}

.pay-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-icon {
    font-size: 24px;
}

/* Security Info */
.security-info {
    text-align: center;
    margin-top: 24px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 20px;
    font-size: 14px;
    color: var(--success-color);
}

.security-icon {
    font-size: 16px;
}

/* Success Page */
.success-container,
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.success-animation {
    margin-bottom: 32px;
}

.checkmark-circle {
    width: 120px;
    height: 120px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease-out;
}

.checkmark {
    font-size: 64px;
    color: white;
    animation: checkmark 0.5s ease-out 0.3s both;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.success-container h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--success-color);
}

.success-message {
    font-size: 16px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 32px;
}

.success-details {
    width: 100%;
    max-width: 400px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    padding: 24px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--tg-theme-hint-color);
    font-size: 15px;
}

.detail-value {
    font-weight: 600;
    font-size: 15px;
}

/* Error Page */
.error-animation {
    margin-bottom: 32px;
}

.error-circle {
    width: 120px;
    height: 120px;
    background: var(--error-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease-out;
}

.error-mark {
    font-size: 64px;
    color: white;
}

.error-container h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--error-color);
}

.error-message {
    font-size: 16px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 32px;
    padding: 0 24px;
}

.retry-button {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-button-text-color);
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(36, 129, 204, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    .amount {
        font-size: 40px;
    }
    
    .currency {
        font-size: 28px;
    }
    
    .pay-button {
        font-size: 16px;
        padding: 16px 20px;
    }
}

