* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* ===== Dynamic Background ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* Animated gradient mesh */
.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(79, 172, 254, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #0a0817 0%, #1a1440 30%, #221b4a 60%, #0d0b1a 100%);
    animation: gradientShift 15s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% {
        background:
            radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
            radial-gradient(ellipse at 80% 20%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
            radial-gradient(ellipse at 50% 80%, rgba(79, 172, 254, 0.1) 0%, transparent 50%),
            linear-gradient(135deg, #0a0817 0%, #1a1440 30%, #221b4a 60%, #0d0b1a 100%);
    }
    50% {
        background:
            radial-gradient(ellipse at 30% 40%, rgba(102, 126, 234, 0.18) 0%, transparent 50%),
            radial-gradient(ellipse at 70% 30%, rgba(240, 147, 251, 0.12) 0%, transparent 50%),
            radial-gradient(ellipse at 50% 70%, rgba(0, 242, 254, 0.12) 0%, transparent 50%),
            linear-gradient(135deg, #14102e 0%, #221b4a 30%, #2a2056 60%, #14102e 100%);
    }
    100% {
        background:
            radial-gradient(ellipse at 60% 30%, rgba(102, 126, 234, 0.2) 0%, transparent 50%),
            radial-gradient(ellipse at 30% 70%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
            radial-gradient(ellipse at 70% 60%, rgba(79, 172, 254, 0.08) 0%, transparent 50%),
            linear-gradient(135deg, #0d0b1a 0%, #1a1440 30%, #302b63 60%, #0a0817 100%);
    }
}

/* Floating orbs - enhanced */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    will-change: transform;
}

.bg-orb-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.1) 100%);
    top: -20%;
    left: -15%;
    animation: orbFloat1 18s ease-in-out infinite;
}

.bg-orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(240, 147, 251, 0.2) 0%, rgba(245, 87, 108, 0.1) 100%);
    bottom: -20%;
    right: -15%;
    animation: orbFloat2 15s ease-in-out infinite;
}

.bg-orb-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.15) 0%, rgba(0, 242, 254, 0.05) 100%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat3 20s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(60px, -40px) scale(1.08); }
    50% { transform: translate(-30px, 50px) scale(0.92); }
    75% { transform: translate(40px, 30px) scale(1.05); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-50px, 30px) scale(1.05); }
    50% { transform: translate(40px, -40px) scale(0.95); }
    75% { transform: translate(-30px, -20px) scale(1.03); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    33% { transform: translate(-40%, -60%) scale(1.1); }
    66% { transform: translate(-60%, -40%) scale(0.9); }
}

/* Star field - multiple layers */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: var(--min-opacity); transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* Grid overlay - finer */
.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* Subtle particle dust */
.bg-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: dustFloat 30s linear infinite;
}

@keyframes dustFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-25px); }
}

/* Shooting stars - more elegant */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: linear-gradient(to right, transparent, #fff);
    border-radius: 50%;
    animation: shootingStar var(--speed) linear infinite;
    animation-delay: var(--delay);
    opacity: 0;
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 1px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(100%);
}

@keyframes shootingStar {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 0;
    }
    2% {
        opacity: 1;
    }
    6% {
        transform: translateX(300px) translateY(150px);
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

/* Glass Card - enhanced */
.card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(32px) saturate(1.5);
    -webkit-backdrop-filter: blur(32px) saturate(1.5);
    border-radius: 28px;
    padding: 44px 38px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(255, 255, 255, 0.03);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

/* Card shimmer */
.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 20%,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 50%
    );
    pointer-events: none;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    animation: cardShimmer 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cardShimmer {
    0%, 100% { left: -100%; }
    50% { left: 150%; }
}

.card:hover {
    box-shadow:
        0 12px 56px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
}

.header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.header .icon {
    font-size: 52px;
    margin-bottom: 14px;
    display: inline-block;
    animation: iconFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 4px 20px rgba(102, 126, 234, 0.3));
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-4px) scale(1.02); }
    50% { transform: translateY(0) scale(1); }
    75% { transform: translateY(-2px) scale(1.01); }
}

.header h1 {
    font-size: 26px;
    color: #fff;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #c8d0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    letter-spacing: 0.3px;
}

/* Slider */
.slider-container {
    position: relative;
    width: 100%;
    height: 52px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 26px;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.3s ease;
}

.slider-container:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.slider-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    border-radius: 26px;
    transition: width 0.3s ease;
}

.slider-container:not(.success):not(.fail) .slider-progress {
    animation: progressShimmer 2s linear infinite;
}

@keyframes progressShimmer {
    0% { background-position: 0% 0; }
    100% { background-position: -200% 0; }
}

.slider-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 1;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.slider-thumb {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 2;
    transition: box-shadow 0.2s, transform 0.15s;
}

.slider-thumb:active {
    cursor: grabbing;
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
    transform: scale(1.06);
}

.slider-thumb .arrow {
    font-size: 20px;
    color: #667eea;
    transition: transform 0.3s;
}

/* ===== Slider States ===== */
.slider-container.success .slider-thumb {
    background: #52c41a !important;
    cursor: default;
    left: calc(100% - 51px) !important;
}

.slider-container.success .slider-thumb .arrow {
    color: #fff;
    transform: rotate(90deg);
}

.slider-container.success .slider-text {
    color: rgba(255, 255, 255, 0.9);
}

.slider-container.success .slider-progress {
    background: linear-gradient(90deg, #52c41a, #73d13d) !important;
    animation: none !important;
}

.slider-container.fail .slider-thumb {
    background: #ff4d4f !important;
    cursor: default;
    left: 1px !important;
}

.slider-container.fail .slider-thumb .arrow {
    color: #fff;
    transform: rotate(135deg);
}

.slider-container.fail .slider-text {
    color: rgba(255, 255, 255, 0.9);
}

.slider-container.fail .slider-progress {
    background: linear-gradient(90deg, #ff4d4f, #ff7875) !important;
    width: 100% !important;
    animation: none !important;
}

/* Status - Simplified single line */
.status-area {
    margin-bottom: 0;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.4s ease;
}

.status-icon {
    font-size: 10px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

/* Pending state */
.status-item.pending .status-icon {
    animation: pulse 1.5s infinite;
    color: rgba(255, 255, 255, 0.4);
}

/* Detecting state - spinner replacing icon */
.status-item.detecting .status-icon {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-right-color: #764ba2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    font-size: 0;
    background: transparent;
}

.status-item.detecting {
    background: rgba(102, 126, 234, 0.08);
    border-color: rgba(102, 126, 234, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

/* Success state */
.status-item.success .status-icon {
    font-size: 16px;
    color: #52c41a;
}

.status-item.success {
    background: rgba(82, 196, 26, 0.08);
    border-color: rgba(82, 196, 26, 0.2);
    color: #95de64;
}

/* Fail state */
.status-item.fail .status-icon {
    font-size: 16px;
    color: #ff4d4f;
}

.status-item.fail {
    background: rgba(255, 77, 79, 0.08);
    border-color: rgba(255, 77, 79, 0.2);
    color: #ff7875;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}