:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #334155;
    --secondary-hover: #475569;
    --accent-color: #ec4899;
    --bg-dark: #0f172a;
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success-color: #10b981;
    --error-color: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Ambient Glow */
.background-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 40%);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.header p {
    color: var(--text-dim);
    font-size: 0.875rem;
}

.logo-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Camera Feed Wrapper */
.camera-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    /* Square for facial focus */
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    outline: 2px solid var(--glass-border);
}

#video-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* Mirror effect */
}

/* Scanning Animation */
.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(99, 102, 241, 0) 50%, rgba(99, 102, 241, 0.1) 50%, rgba(99, 102, 241, 0) 51%);
    background-size: 100% 200%;
    animation: scan 3s linear infinite;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    top: 50%;
    animation: scan-move 2s ease-in-out infinite alternate;
    opacity: 0.7;
}

@keyframes scan-move {
    0% {
        top: 10%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 90%;
        opacity: 0;
    }
}

/* Controls */
.controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-message {
    min-height: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dim);
    transition: color 0.3s;
}

.status-message.success {
    color: var(--success-color);
}

.status-message.error {
    color: var(--error-color);
}

.button-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    /* Slightly smaller text for 2 buttons */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #334155;
    box-shadow: none;
}

/* Footer Date/Time */
.footer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.footer span,
.footer p {
    font-variant-numeric: tabular-nums;
}

/* Utilities */
.hidden {
    display: none;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .glass-card {
        padding: 1.5rem;
    }

    .button-group {
        flex-direction: column;
    }
}