/* Face Login Page Styles */

:root {
    --bg: #0f172a;
    --fg: #f8fafc;
    --primary: #3b82f6;
    --success: #22c55e;
    --danger: #ef4444;
    --muted: #64748b;
    --card: #1e293b;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Main container */
.face-login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: relative;
}

/* Scanning ring animation */
.scan-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% - 2rem));
    width: 280px;
    height: 280px;
    pointer-events: none;
}

.ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.ring-outer {
    border-color: rgba(59, 130, 246, 0.15);
}

.ring-inner {
    inset: 10px;
    border-color: rgba(59, 130, 246, 0.1);
}

/* Scanning state */
.scan-ring.scanning .ring-outer {
    border-color: rgba(59, 130, 246, 0.4);
    border-top-color: var(--primary);
    animation: spin 1.5s linear infinite;
}

.scan-ring.scanning .ring-inner {
    border-color: rgba(59, 130, 246, 0.2);
    border-bottom-color: var(--primary);
    animation: spin 2s linear infinite reverse;
}

/* Submitting state */
.scan-ring.submitting .ring-outer {
    border-color: var(--primary);
    animation: pulse-ring 1s ease infinite;
}

.scan-ring.submitting .ring-inner {
    border-color: var(--primary);
    opacity: 0.5;
    animation: pulse-ring 1s ease infinite 0.2s;
}

/* Success state */
.scan-ring.success .ring-outer {
    border-color: var(--success);
    animation: success-ring 0.6s ease forwards;
}

.scan-ring.success .ring-inner {
    border-color: var(--success);
    animation: success-ring 0.6s ease 0.1s forwards;
}

/* Error state */
.scan-ring.error .ring-outer {
    border-color: var(--danger);
}

/* Failed attempt */
.scan-ring.failed .ring-outer {
    border-color: var(--danger);
    animation: shake 0.5s ease;
}

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

@keyframes pulse-ring {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.03); }
}

@keyframes success-ring {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Face frame - circular container for video/icon */
.face-frame {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: var(--card);
    border: 3px solid rgba(59, 130, 246, 0.2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: border-color 0.3s ease;
}

.face-frame.camera-active {
    border-color: rgba(59, 130, 246, 0.4);
}

.face-frame.recognized {
    border-color: var(--success);
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.3);
}

/* Person icon */
.person-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.person-icon svg {
    width: 100px;
    height: 100px;
    color: var(--muted);
    opacity: 0.5;
}

/* Camera video */
#camera-video {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror */
}

/* Hidden capture canvas */
#capture-canvas {
    display: none;
}

/* Status text */
.status-area {
    text-align: center;
}

.status-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--fg);
    transition: color 0.3s;
}

.status-sub {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.3rem;
}

/* Welcome name */
.welcome-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--success);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.welcome-name.visible {
    opacity: 1;
    transform: translateY(0);
}
