/**
 * Стили для страниц оплаты CryptoCloud
 * Современный дизайн с анимациями и таймерами
 */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* Анимированный фон */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.payment-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.payment-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.payment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    opacity: 0.8;
}

.success-card::before {
    background: linear-gradient(90deg, var(--success-color), #34d399);
}

.error-card::before {
    background: linear-gradient(90deg, var(--error-color), #f87171);
}

/* Анимация успеха */
.success-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.checkmark {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: var(--success-color);
    stroke-miterlimit: 10;
    animation: scaleIn 0.5s ease-out;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: var(--success-color);
    fill: rgba(16, 185, 129, 0.1);
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Анимация ошибки */
.error-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.error-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: var(--error-color);
    stroke-miterlimit: 10;
    animation: scaleIn 0.5s ease-out;
}

.error-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: var(--error-color);
    fill: rgba(239, 68, 68, 0.1);
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.error-x {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

/* Заголовки */
.payment-title {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-title {
    background: linear-gradient(135deg, var(--error-color) 0%, #f87171 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.6;
}

.error-subtitle {
    color: var(--error-color);
}

/* Информация о платеже */
.payment-info {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.amount-value {
    color: var(--success-color);
    font-size: 18px;
}

/* Индикатор статуса */
.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.error-status {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.error-dot {
    background: var(--error-color);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.status-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Детали ошибки */
.error-details {
    margin-bottom: 32px;
}

.error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 20px;
}

.error-box h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.error-list {
    list-style: none;
    padding-left: 0;
}

.error-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
}

.error-list li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--error-color);
    font-size: 20px;
}

/* Информация о перенаправлении */
.redirect-info {
    margin-bottom: 32px;
    text-align: center;
}

.redirect-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

#countdown {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 18px;
}

/* Прогресс бар */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 2px;
    transition: width 0.1s linear;
    animation: shimmer 2s infinite;
}

.error-progress {
    background: linear-gradient(90deg, var(--error-color), #f87171);
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Кнопки */
.action-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.btn {
    flex: 1;
    min-width: 150px;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Дополнительная информация */
.additional-info {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.info-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 8px;
}

/* Конфетти canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Адаптивность */
@media (max-width: 640px) {
    .payment-card {
        padding: 32px 24px;
    }

    .payment-title {
        font-size: 24px;
    }

    .payment-subtitle {
        font-size: 16px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Анимация появления элементов */
.payment-info,
.status-indicator,
.redirect-info,
.action-buttons,
.additional-info {
    animation: fadeIn 0.8s ease-out;
    animation-fill-mode: both;
}

.payment-info {
    animation-delay: 0.2s;
}

.status-indicator {
    animation-delay: 0.4s;
}

.redirect-info {
    animation-delay: 0.6s;
}

.action-buttons {
    animation-delay: 0.8s;
}

.additional-info {
    animation-delay: 1s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
