:root {
    --bg: #050507;
    --card-bg: rgba(20, 20, 30, 0.7);
    --primary: #6d28d9;
    --primary-glow: #8b5cf6;
    --accent: #00f0ff;
    --text: #ffffff;
    --text-dim: #9ca3af;
    --success: #10b981;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Space Grotesk', sans-serif; }

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Effects */
.bg-noise {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    z-index: -1;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -2;
    opacity: 0.4;
    animation: float 10s infinite ease-in-out;
}

.orb-1 { width: 400px; height: 400px; background: var(--primary); top: -100px; left: -100px; }
.orb-2 { width: 300px; height: 300px; background: var(--accent); bottom: -50px; right: -50px; animation-delay: -5s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

/* Container */
.container {
    width: 90%;
    max-width: 520px;
    z-index: 10;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo { font-size: 1.5rem; font-weight: 700; color: var(--text); text-shadow: 0 0 10px rgba(255,255,255,0.3); }

.status-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot { width: 6px; height: 6px; background: #34d399; border-radius: 50%; box-shadow: 0 0 8px #34d399; }

.loader-mini {
    width: 16px; height: 16px; 
    border: 2px solid white; border-top-color: transparent; 
    border-radius: 50%; display: inline-block;
    animation: spin 0.8s linear infinite;
}

/* Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}

.card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.2); }

h1 { font-size: 2rem; margin-bottom: 0.5rem; background: linear-gradient(to right, #fff, #a5b4fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text); }
p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.6; margin-bottom: 2rem; }

/* Checkpoint Flow */
.checkpoint-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.checkpoint-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.checkpoint-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(109, 40, 217, 0.2);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: var(--text);
}

.checkpoint-item span {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.checkpoint-arrow {
    color: var(--primary);
    font-size: 1.2rem;
    margin: 0 4px;
}

/* Checkpoint Badge */
.checkpoint-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 2rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-glow));
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-glow));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(109, 40, 217, 0.4);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(109, 40, 217, 0.6); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* Key Display */
.key-display-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--primary);
    padding: 1.5rem;
    border-radius: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: 0.2s;
}

.key-display-box:hover { background: rgba(109, 40, 217, 0.1); }

code { font-family: 'Courier New', monospace; font-size: 1.2rem; color: var(--accent); font-weight: bold; letter-spacing: 2px; }

.copy-hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 8px; }

/* Success/Error Icons */
.success-icon, .error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
}

.success-icon {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success);
    color: var(--success);
}

.error-icon {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    color: #ef4444;
}

/* Utilities */
.hidden { display: none; }
.info-box { background: rgba(255,255,255,0.05); padding: 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; margin-bottom: 20px; color: var(--text-dim); }

/* Loader */
.loader {
    width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer { text-align: center; margin-top: 2rem; color: rgba(255,255,255,0.2); font-size: 0.8rem; }

/* Toast */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: white; color: black; padding: 10px 20px; border-radius: 30px; font-weight: bold;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { from { transform: translate(-50%, 100px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* Responsive */
@media (max-width: 480px) {
    .checkpoint-flow { gap: 4px; }
    .checkpoint-number { width: 35px; height: 35px; font-size: 0.9rem; }
    .checkpoint-item span { font-size: 0.65rem; }
    .checkpoint-arrow { font-size: 1rem; }
}