
:root {
    --primary: #6a1b9a;
    --primary-dark: #4a148c;
    --secondary: #c6ff00;
    --secondary-dark: #aeea00;
    --text-light: #f5f5f5;
    --text-dark: #212121;
    --bg-light: #f9f9f9;
    --bg-dark: #303030;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background-color: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(106, 27, 154, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(106, 27, 154, 0.3);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-dark);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(198, 255, 0, 0.2);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(198, 255, 0, 0.3);
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.input-field:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.1);
}

.screen {
    display: none;
    padding: 24px;
    min-height: 100vh;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    margin-bottom: 24px;
    position: relative;
}

.back-button {
    position: absolute;
    left: 0;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary);
}

.machine-card {
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.machine-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.machine-icon {
    width: 50px;
    height: 50px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
}

.machine-info {
    flex-grow: 1;
}

.machine-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-available {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-busy {
    background-color: #ffebee;
    color: #c62828;
}

.qr-scanner {
    width: 280px;
    height: 280px;
    border: 4px solid var(--secondary);
    border-radius: 16px;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

.qr-scanner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--secondary);
    animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.success-animation {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    border-radius: 50%;
    background-color: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(46, 125, 50, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

.face-recognition {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 4px dashed var(--primary);
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.face-recognition::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--secondary);
    animation: rotate 4s linear infinite;
}

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

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background-color: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.logo-icon::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 8px solid var(--secondary);
}

.verification-code {
    display: flex;
    justify-content: space-between;
    margin: 24px 0;
}

.code-input {
    width: 50px;
    height: 60px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

.code-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.1);
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.btn-resend {
    background-color: none;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-resend.disabled {
    background-color: none !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.resend-timer {
    display: none;
    margin-left: 10px;
    color: #666;
    font-size: 0.9em;
}

/* Adicione ao final do arquivo */

.progress-container {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.ocr-result {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary);
    padding: 15px;
    border-radius: 0 8px 8px 0;
    margin-top: 15px;
}

.ocr-highlight {
    background-color: #fffacd;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
}

.qr-scanner {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 1/1; /* Mantém proporção quadrada */
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.qr-frame {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.7);
}

.qr-line {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 2px;
    background: rgba(255, 0, 0, 0.5);
    animation: scanLine 2s infinite linear;
}

@keyframes scanLine {
    0% { top: 10%; }
    100% { top: 90%; }
}

#qr-camera-feed {
    display: block;
    width: 100%;
    height: 100%;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-bounce {
  animation: bounce 2s infinite;
}


/* Container principal */
.face-recognition-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

/* Molde circular sobreposto */
.circle-frame {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    pointer-events: none;
}

/* Placeholder da câmera */
#camera-placeholder {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
}

/* Botões */
#capture-photo-btn, #complete-recognition-btn {
    transition: all 0.3s ease;
}

/* Document upload */
.document-upload-label {
    transition: all 0.2s ease;
}

.document-upload-label:hover {
    background-color: #f3f4f6;
    border-color: #3b82f6;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 640px) {
    .face-recognition-container {
        max-width: 280px;
    }
    
    .circle-frame {
        width: 260px;
        height: 260px;
    }
}

video {
  width: 100% !important;
  height: auto !important;
  transform: none !important;
  object-fit: contain !important;
  background-color: #000 !important;
}

/* Container deve ter posição relativa */
video-container, .video-wrapper, [class*="video"] {
  position: relative !important;
}