/**
 * WIZARD DE CAPTURA BIOMÉTRICA
 * Estilos para o modal de enrollment com 3 etapas.
 */

#modal-face-enrollment.modal-overlay {
    z-index: 2000;
}

.enrollment-modal {
    max-width: 950px;
    width: 95%;
    padding: 2rem;
    z-index: 1050; /* Força sobreposição */
    max-height: 95vh;
    overflow-y: auto;
}

/* --- Layout Grid (Duas Colunas) --- */
.enrollment-body-grid {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    margin-top: 1rem;
}

.enrollment-col-left {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.enrollment-col-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--gray-border);
}

@media (max-width: 850px) {
    .enrollment-body-grid {
        flex-direction: column;
        gap: 1.5rem;
    }
    .enrollment-modal {
        max-width: 600px;
        padding: 1.2rem;
    }
    .enrollment-col-right {
        padding: 1rem;
    }
}

.enrollment-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.enrollment-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.enrollment-header h2 i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.enrollment-subtitle {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin: 0;
}

/* --- Progress Steps --- */
.enrollment-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.progress-step span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-light);
    color: var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    transition: all 0.4s ease;
}

.progress-step.active .step-circle {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(210, 35, 42, 0.35);
    transform: scale(1.1);
}

.progress-step.done .step-circle {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.progress-line {
    width: 50px;
    height: 3px;
    background: var(--gray-light);
    margin: 0 0.5rem;
    margin-bottom: 1.4rem;
    border-radius: 2px;
    transition: background 0.4s ease;
}

.progress-line.done {
    background: var(--success);
}

/* --- Video Capture Area --- */
.enrollment-capture-area {
    position: relative;
    margin-bottom: 1.2rem;
}

.enrollment-instruction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.instruction-icon {
    font-size: 1.3rem;
    animation: pulseIcon 2s ease-in-out infinite;
}

@keyframes pulseIcon {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.enrollment-video-wrapper {
    background: #000;
    text-align: center;
    margin-bottom: 1.2rem;
    border-radius: 8px;
    overflow: hidden;
}

.enrollment-camera-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

#enrollment-video {
    max-width: 100%;
    height: auto;
    max-height: 40vh;
    display: block;
    object-fit: contain;
    transform: scaleX(-1);
}

#enrollment-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
}

.face-guide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.face-oval {
    width: 45%;
    height: 70%;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transition: border-color 0.3s;
}

.face-guide.detected .face-oval {
    border-color: var(--success);
    box-shadow: 0 0 30px rgba(40, 167, 69, 0.15) inset;
}

/* --- Controls --- */
.enrollment-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #16213e, #1a1a2e);
    border-radius: 0 0 10px 10px;
}

.quality-indicator {
    color: var(--warning);
    font-size: 0.85rem;
    font-weight: 600;
}

.quality-indicator.ready {
    color: var(--success);
}

.btn-capture {
    padding: 0.7rem 1.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-capture:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(210, 35, 42, 0.4);
}

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

.btn-capture.capturing {
    animation: flashCapture 0.3s ease;
}

@keyframes flashCapture {
    0% { background: white; color: var(--primary); }
    100% { background: var(--primary); color: white; }
}

/* --- Preview Grid --- */
.enrollment-previews {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.preview-slot {
    text-align: center;
    position: relative;
}

.preview-slot span {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    margin-top: 0.4rem;
    text-transform: uppercase;
}

.preview-placeholder {
    aspect-ratio: 1;
    background: var(--bg-light);
    border: 2px dashed var(--gray-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-light);
    font-size: 2rem;
    transition: all 0.4s ease;
}

.preview-slot.captured .preview-placeholder {
    border-color: var(--success);
    border-style: solid;
    background: none;
    overflow: hidden;
    padding: 0;
}

.preview-slot.captured .preview-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* --- Actions --- */
.enrollment-actions {
    display: flex;
    gap: 0.8rem;
}

.enrollment-actions .btn-primary {
    flex: 2;
}

.enrollment-actions .btn-secondary {
    flex: 1;
}

.enrollment-actions .btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Landmark Legend (small) --- */
.landmark-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-gray);
}

.landmark-legend span::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.legend-eyes::before { background: #00d4ff; }
.legend-nose::before { background: #00ff88; }
.legend-mouth::before { background: #ff4466; }
.legend-jaw::before { background: rgba(255, 255, 255, 0.6); }
