/* ============================================
   LynFinanzas - Camera & Liveness Styles
   Vibrant Light Theme Edition
   ============================================ */

/* Camera Container */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #1a1a2e;
    aspect-ratio: 3/4;
    box-shadow: var(--shadow-xl);
}

.camera-container.landscape {
    aspect-ratio: 4/3;
}

.camera-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-container video.no-mirror {
    transform: scaleX(1);
}

.camera-container canvas {
    display: none;
}

/* Camera overlay - INE guide */
.camera-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.ine-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    aspect-ratio: 1.585/1;
    border: 2px dashed rgba(108, 92, 231, 0.7);
    border-radius: 12px;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.35);
}

.ine-guide-text {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    background: rgba(108, 92, 231, 0.85);
    padding: 4px 14px;
    border-radius: var(--radius-full);
}

/* Face guide for selfie */
.face-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 200px;
    height: 260px;
    border: 3px solid rgba(108, 92, 231, 0.5);
    border-radius: 50%;
}

.face-guide.detected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.4);
    animation: face-pulse 1s ease-in-out infinite;
}

.face-guide.success {
    border-color: var(--success);
    box-shadow: 0 0 30px rgba(0, 184, 148, 0.5);
}

@keyframes face-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(108, 92, 231, 0.3); }
    50% { box-shadow: 0 0 35px rgba(108, 92, 231, 0.5); }
}

/* Camera controls */
.camera-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
}

.capture-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: transparent;
    border: 4px solid var(--accent-primary);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
}

.capture-btn::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: var(--accent-gradient);
    transition: all var(--transition-base);
}

.capture-btn:hover {
    transform: scale(1.08);
    box-shadow: var(--accent-glow-strong);
}

.capture-btn:active::before {
    transform: scale(0.85);
}

.capture-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.camera-switch-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.camera-switch-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Photo preview */
.photo-preview {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: var(--space-lg) 0;
    box-shadow: var(--shadow-md);
}

.photo-preview img {
    width: 100%;
    border-radius: var(--radius-lg);
}

.photo-preview-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

/* ============================================
   Liveness Detection
   ============================================ */
.liveness-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: var(--space-xl);
    z-index: 20;
    pointer-events: none;
}

.liveness-instruction {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-xl);
    text-align: center;
    animation: fadeIn 0.3s ease;
    pointer-events: auto;
    box-shadow: var(--shadow-lg);
}

.liveness-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    animation: liveness-bounce 1s ease-in-out infinite;
}

@keyframes liveness-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.liveness-text {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.liveness-subtext {
    font-size: 0.813rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Liveness progress */
.liveness-progress {
    position: absolute;
    top: var(--space-lg);
    left: var(--space-lg);
    right: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    z-index: 25;
}

.liveness-step {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.liveness-step.completed {
    background: var(--accent-primary);
}

.liveness-step.active {
    background: rgba(255,255,255,0.25);
}

.liveness-step.active::after {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    animation: liveness-fill 5s linear forwards;
}

@keyframes liveness-fill {
    to { width: 100%; }
}

/* Liveness success animation */
.liveness-success {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 30;
    animation: fadeIn 0.3s ease;
}

.liveness-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    animation: checkmark-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--accent-glow-strong);
}

@keyframes checkmark-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Camera permission screen */
.camera-permission {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl);
    min-height: 300px;
}

.camera-permission-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
    color: var(--accent-primary);
}

.camera-permission h3 {
    margin-bottom: var(--space-sm);
}

.camera-permission p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    max-width: 300px;
}

/* Camera loading */
.camera-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 46, 0.95);
    z-index: 5;
}

.camera-loading-text {
    color: rgba(255,255,255,0.7);
    margin-top: var(--space-md);
    font-size: 0.875rem;
}
