/* ============================================
   PAYMENT PAGE STYLES
   Modern, Dark Theme with Gradient Accents
   ============================================ */

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-elevated: #1c1c28;
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* App Container */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    margin-bottom: 20px;
}

.title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
}

.input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-amount {
    font-size: 1.5rem;
    font-weight: 700;
    /* Убираем счетчик (стрелки) у поля ввода числа */
    -moz-appearance: textfield;
}

.input-amount::-webkit-inner-spin-button,
.input-amount::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-suffix {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
}

.hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Payment Methods */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

#paymentMethodGroup .payment-methods {
    grid-template-columns: repeat(3, 1fr);
}

.method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.method-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-secondary);
}

.method-card.active {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.method-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
    filter: grayscale(100%);
}

.method-card.disabled .method-icon {
    color: #666 !important;
}

.method-card.disabled .method-name {
    color: #666 !important;
}

.method-card.disabled:hover {
    border-color: #3a3a3a !important;
    background: #2a2a2a !important;
}

/* Partner payment text */
.partner-payment-text {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 12px;
    white-space: nowrap;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.crypto-partner-info {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #7373c3;
    margin-bottom: 8px;
    margin-left: 4px;
    white-space: nowrap;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: left;
}

.method-card input {
    display: none;
}

.method-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.method-icon svg {
    width: 32px;
    height: 32px;
}

.method-card.active .method-icon {
    color: var(--accent-primary);
}

.method-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.method-card.active .method-name {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.btn-large {
    padding: 18px 32px;
    font-size: 1.1rem;
}

.btn-icon {
    transition: transform 0.2s ease;
}

.btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Loading */
.loading {
    text-align: center;
    padding: 48px 24px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
    will-change: transform;
}

.spinner.large {
    width: 56px;
    height: 56px;
    border-width: 4px;
}

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

.loading p {
    color: var(--text-secondary);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* ============================================
   PAYMENT PAGE
   ============================================ */

.payment-card {
    padding: 28px;
}

.payment-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.payment-header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 16px;
}

.payment-amount {
    display: flex;
    align-items: center;
    gap: 12px;
}

.amount-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-order-number {
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-order-number-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.payment-order-number-center .order-label {
    font-size: 1.25rem !important;
    font-weight: 800;
    color: var(--accent-primary) !important;
}

.payment-order-number-center .order-value {
    font-size: 1.25rem !important;
    font-weight: 800;
    color: var(--accent-primary) !important;
}

.order-label {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.order-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.amount-currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.copy-btn-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.copy-btn-header:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.copy-btn-header.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.payment-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.payment-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
}

.payment-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Requisites */
.requisites {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

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

.requisite-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.requisite-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.value-text {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 1px;
}

.value-amount {
    font-size: 1.25rem;
    color: var(--success);
}

.currency-symbol {
    font-size: 1.4rem;
}

.requisite-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.requisite-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.requisite-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

/* Copy Button */
.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Notice */
.payment-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    color: var(--warning);
    font-size: 0.875rem;
}

.payment-notice svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.sbp-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    margin-top: 12px;
    color: var(--accent-primary);
    font-size: 0.8rem;
}

.sbp-notice svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ============================================
   RESULT PAGES
   ============================================ */

.result-card {
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.result-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-icon.success {
    color: var(--success);
}

.result-icon.cancel,
.result-icon.error {
    color: var(--error);
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.result-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.result-actions {
    margin-top: 32px;
}

.result-order-number {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.result-order-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.result-order-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* QR-код */
.qr-code-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.qr-code-container canvas {
    max-width: 100%;
    height: auto;
}

.result-details {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 32px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.detail-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 600;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 100;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.modal-content h3 {
    font-size: 1.25rem;
    margin: 24px 0 8px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.success-icon {
    margin: 0 auto;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-icons {
    display: flex;
    gap: 8px;
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .card {
        padding: 24px 20px;
        border-radius: var(--radius-lg);
    }
    
    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .method-card {
        padding: 12px 8px;
    }
    
    .method-name {
        font-size: 0.7rem;
    }
    
    .amount-value {
        font-size: 2rem;
    }
    
    .value-text {
        font-size: 0.95rem;
        letter-spacing: 0;
    }
}

/* Уведомление о проверке оплаты */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 1000;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
    pointer-events: none;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    min-width: 300px;
    max-width: 90vw;
}

.notification-content svg {
    flex-shrink: 0;
    color: var(--accent-primary);
}

/* Кнопка техподдержки */
.btn-support {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-support:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-support svg {
    flex-shrink: 0;
}
