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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

.section {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

.button-group {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.btn {
    padding: 15px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.price {
    font-size: 18px;
    font-weight: 700;
    color: var(--success-color);
    margin-top: 10px;
}

.packages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
}

@media (max-width: 480px) {
    .packages {
        grid-template-columns: 1fr;
    }
}

.package {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.package:hover, .package.selected {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.package .stars {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.package .price {
    font-size: 14px;
    color: var(--success-color);
    margin: 0;
}

.payment-methods {
    margin: 20px 0;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.payment-method:hover, .payment-method.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.method-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.method-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.method-desc {
    font-size: 12px;
    color: #666;
}

.orders-list {
    max-height: 400px;
    overflow-y: auto;
}

.order-item {
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.order-details {
    font-size: 12px;
    color: #666;
}

.order-details div {
    margin-bottom: 4px;
}

.order-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.no-orders {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.navigation {
    display: flex;
    justify-content: space-around;
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-top: auto;
    box-shadow: var(--box-shadow);
}

.nav-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #667eea;
    transition: all 0.3s ease;
}

.nav-btn.active, .nav-btn:hover {
    background: #667eea;
    color: white;
}

.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-page {
    text-align: center;
    padding: 40px 20px;
}

.status-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.status-page h1 {
    margin-bottom: 15px;
    color: #333;
}

.status-page p {
    margin-bottom: 25px;
    color: #e2ffd8;
}

.support-link {
    display: block;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
}

.support-link:hover {
    text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .section {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 20px;
    }
}

/* Специфические стили для Telegram */
.tg-background {
    background: var(----tg-theme-bg-color, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
}

.tg-text {
    color: var(--tg-theme-text-color, #333);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

/* Стили для главной страницы согласно скриншоту */
.recipient-field {
    position: relative;
}

.current-user {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.current-user:hover {
    background: #667eea;
    color: white;
}

.price-display {
    margin-top: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #28a745;
}

.quick-amounts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 15px 0;
}

.quick-amount {
    padding: 10px 5px;
    text-align: center;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.quick-amount:hover,
.quick-amount.active {
    border-color: #667eea;
    background: #f8f9ff;
    color: #667eea;
}

.order-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.summary-item.total {
    border-top: 1px solid #dee2e6;
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 700;
    font-size: 16px;
    color: #28a745;
}

.agreement-checkbox {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.agreement-checkbox input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.agreement-checkbox label {
    font-size: 14px;
    line-height: 1.4;
    color: #555;
    cursor: pointer;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group input::placeholder {
    color: #999;
}

#mainSection {
    text-align: left;
}

#mainSection .btn {
    width: 100%;
    margin-top: 10px;
}

/* Адаптивность для быстрого выбора */
@media (max-width: 480px) {
    .quick-amounts {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-amount {
        padding: 12px 5px;
        font-size: 13px;
    }
}

/* Стили для навигации */
.navigation {
    display: flex;
    justify-content: space-around;
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-top: auto;
    box-shadow: var(--box-shadow);
}

.nav-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #667eea;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    margin: 0 5px;
}

.nav-btn.active,
.nav-btn:hover {
    background: #667eea;
    color: white;
}
/* Улучшенные стили для соответствия скриншоту */
.current-user-hint {
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    font-size: 14px;
    color: #1976d2;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.current-user-hint:hover {
    background: #bbdefb;
    transform: translateY(-1px);
}

.input-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #f44336;
    display: none;
}

.agreement-section {
    margin: 25px 0;
}

.agreement-checkbox {
    padding: 18px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.agreement-checkbox:has(input:checked) {
    background: #e8f5e8;
    border-color: #4caf50;
}

.agreement-checkbox input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.3);
    accent-color: #4caf50;
}

.agreement-checkbox label {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    cursor: pointer;
    font-weight: 500;
}

.large-btn {
    padding: 18px 24px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 12px;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-active {
    background: var(--primary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Стили для раздела оплаты */
.payment-header {
    text-align: center;
    margin-bottom: 25px;
}

.payment-header h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 5px;
}

.payment-method {
    position: relative;
    padding: 20px;
    margin-bottom: 12px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    display: flex;
    align-items: center;
}

.payment-method:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.payment-method.selected {
    border-color: #4caf50;
    background: #f1f8e9;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.method-check {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.payment-method.selected .method-check {
    opacity: 1;
}

.method-icon {
    font-size: 32px;
    margin-right: 15px;
    width: 50px;
    text-align: center;
}

.method-name {
    font-weight: 700;
    margin-bottom: 4px;
    color: #333;
    font-size: 16px;
}

.method-desc {
    font-size: 13px;
    color: #666;
}

.order-summary-payment {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 25px 0;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
}

.summary-item.total {
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    padding-top: 12px;
    margin-top: 12px;
    font-weight: 800;
    font-size: 18px;
}

.payment-btn {
    margin-top: 10px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.payment-security {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.security-badge {
    padding: 8px 16px;
    background: #e8f5e8;
    border-radius: 20px;
    font-size: 12px;
    color: #4caf50;
    font-weight: 600;
}

/* Стили для истории заказов */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h2 {
    color: #333;
    font-size: 22px;
}

.btn-refresh {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.btn-refresh:hover {
    background: #f0f0f0;
}

.loading-history {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Улучшенная навигация */
.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-text {
    font-size: 12px;
    font-weight: 600;
}

.navigation {
    display: flex;
    justify-content: space-around;
    background: white;
    border-radius: 20px;
    padding: 12px 8px;
    margin-top: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background: none;
    border: none;
    padding: 12px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    margin: 0 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-btn.active,
.nav-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Улучшенный индикатор загрузки */
.loading-text {
    margin-top: 15px;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

/* Анимации */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-active {
    animation: pulse 2s infinite;
}

/* Адаптивность */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .section {
        padding: 20px 15px;
    }
    
    .large-btn {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .payment-method {
        padding: 15px;
    }
    
    .method-icon {
        font-size: 28px;
        margin-right: 12px;
    }
    
    .security-badge {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .nav-btn {
        padding: 10px 6px;
        font-size: 11px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
}

/* Темная тема для Telegram */
@media (prefers-color-scheme: dark) {
    .tg-background {
        background: var(--tg-theme-bg-color, #1e1e1e);
    }
    
    .tg-text {
        color: var(--tg-theme-text-color, #ffffff);
    }
}
/* Добавьте эти стили в конец файла style.css */

.agreement-checkbox {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.agreement-checkbox input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.agreement-checkbox label {
    font-size: 14px;
    line-height: 1.4;
    color: #555;
    cursor: pointer;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group input::placeholder {
    color: #999;
}

#mainSection {
    text-align: left;
}

#mainSection .btn {
    width: 100%;
    margin-top: 10px;
}
/* Стили для валидации юзернейма */
.input-error {
    border-color: #f44336 !important;
    background-color: #fff5f5 !important;
}

.input-success {
    border-color: #4caf50 !important;
    background-color: #f8fff8 !important;
}

.input-hint.error {
    color: #f44336;
    display: block;
}

.input-hint.success {
    color: #4caf50;
    display: block;
}

#usernameHint {
    margin-top: 6px;
    font-size: 12px;
    transition: all 0.3s ease;
}

/* Анимации для валидации */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.input-error {
    animation: shake 0.5s ease-in-out;
}

/* Стили для валидации */
.input-error {
    border-color: #ff4444 !important;
    background-color: #fff5f5 !important;
    animation: shake 0.5s ease-in-out;
}

.input-success {
    border-color: #00C851 !important;
    background-color: #f8fff8 !important;
}

.input-hint {
    margin-top: 5px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    display: none;
}

.input-hint.error {
    background-color: #ff4444;
    color: white;
    display: block;
}

.input-hint.success {
    background-color: #00C851;
    color: white;
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Убедитесь, что эти элементы существуют */
.current-user-hint {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    font-size: 14px;
    color: #1976d2;
    cursor: pointer;
}

.current-user-hint:hover {
    background: #bbdefb;
}

/* Стили для модального окна Heleket */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.modal-content p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.modal-buttons .btn {
    padding: 12px 20px;
    min-width: 140px;
}

.payment-link {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.link-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.link-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 12px;
    background: #f8f9fa;
}

.btn-copy {
    padding: 10px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-copy:hover {
    background: #5a6fd8;
}

/* Адаптивность для модального окна */
@media (max-width: 480px) {
    .modal-content {
        padding: 20px 15px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-buttons .btn {
        min-width: auto;
        width: 100%;
    }
}

/* Стили для ссылок в навигации */
.navigation a.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 12px 8px;
    background: none;
    border: none;
    color: #666;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    flex: 1;
}

.navigation a.nav-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.navigation a.nav-btn.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-text {
    font-weight: 500;
}

/* Стили для ссылки в соглашении */
.offer-link {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.offer-link:hover {
    text-decoration: underline;
}