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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1a1a25;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --text-primary: #f0f0f5;
    --text-secondary: #9595a8;
    --text-muted: #6a6a7a;
    --accent: #6C5CE7;
    --accent-light: #a855f7;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.3);
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.3);
    --warning: #f59e0b;
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* ===== Particles Background ===== */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(1);
    }
}

/* ===== Header ===== */
.header {
    position: relative;
    z-index: 10;
    padding: 24px 32px;
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.2rem;
    transition: opacity var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

/* ===== Main ===== */
.main {
    position: relative;
    z-index: 10;
    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);
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-light), transparent);
    opacity: 0.8;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card--error::before {
    background: linear-gradient(90deg, transparent, var(--error), transparent);
}

/* ===== Card Icon ===== */
.card__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.1);
    border: 2px solid rgba(108, 92, 231, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    animation: iconPulse 2s ease-in-out infinite;
}

.card__icon svg {
    width: 28px;
    height: 28px;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 20px 4px var(--accent-glow); }
}

.card__icon--success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--success);
    animation-name: iconPulseSuccess;
}

@keyframes iconPulseSuccess {
    0%, 100% { box-shadow: 0 0 0 0 var(--success-glow); }
    50% { box-shadow: 0 0 20px 4px var(--success-glow); }
}

.card__icon--error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
    animation: none;
}

/* ===== Typography ===== */
.card__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.card__text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.highlight {
    color: var(--accent-light);
    font-weight: 600;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--accent-glow);
}

.btn--primary:active:not(:disabled) {
    transform: translateY(0);
}

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

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

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

.btn__arrow {
    width: 18px;
    height: 18px;
    transition: transform var(--transition);
}

.btn:hover .btn__arrow {
    transform: translateX(3px);
}

/* ===== hCaptcha ===== */
.captcha-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

/* ===== Steps ===== */
.step {
    display: none;
    animation: stepIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.step--active {
    display: block;
}

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

/* ===== Spinner ===== */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 3px solid transparent;
    border-top-color: var(--accent-light);
    border-radius: 50%;
    animation: spin 1.2s linear infinite reverse;
}

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

/* ===== Progress Bar ===== */
.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 3px;
    transition: width 0.4s ease;
    position: relative;
}

.progress-bar__fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -1px;
    bottom: -1px;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 0 3px 3px 0;
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-light);
    min-width: 36px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ===== Check List ===== */
.check-list {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.check-item--active {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(108, 92, 231, 0.05);
}

.check-item--done {
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--text-primary);
}

.check-item--fail {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.check-item__icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Dot pulse for pending */
.dot-pulse {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
}

.check-item--active .dot-pulse {
    background: var(--accent);
    animation: dotPulse 1s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0.5; }
}

/* Check mark for done */
.check-item__icon--done {
    color: var(--success);
}

.check-item__icon--done svg {
    width: 18px;
    height: 18px;
}

/* Cross for fail */
.check-item__icon--fail {
    color: var(--error);
}

.check-item__icon--fail svg {
    width: 18px;
    height: 18px;
}

/* ===== Player Badge ===== */
.player-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.player-badge__name {
    font-weight: 700;
    font-size: 1rem;
}

.player-badge__status {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
    background: rgba(34, 197, 94, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
}

/* ===== Footer ===== */
.footer {
    position: relative;
    z-index: 10;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer a:hover {
    color: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 540px) {
    .card {
        padding: 36px 24px;
    }

    .card__title {
        font-size: 1.25rem;
    }

    .header {
        padding: 16px 20px;
    }

    .footer {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* ===== Warning Icon (VPN) ===== */
.card__icon--warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning);
    animation-name: iconPulseWarning;
}

@keyframes iconPulseWarning {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 20px 4px rgba(245, 158, 11, 0.3); }
}

.card__icon--success-outline {
    background: rgba(108, 92, 231, 0.1);
    border-color: rgba(108, 92, 231, 0.3);
    color: var(--accent);
    animation-name: iconPulse;
}

/* ===== VPN Steps ===== */
.vpn-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
    text-align: left;
}

.vpn-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.vpn-step__num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ===== Button icon ===== */
.btn__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===== Retry spinner on button ===== */
.btn--loading .btn__icon {
    animation: spin 0.8s linear infinite;
}

.btn--loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ===== Shake animation ===== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(6px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
    90% { transform: translateX(2px); }
}
