@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Paleta Dark Orange & Glass */
    --bg-app: #0d0907; 
    --card-bg: rgba(255, 102, 0, 0.03); 
    --primary: #ff6600; 
    --primary-hover: #e65c00;
    --primary-glow: rgba(255, 102, 0, 0.4);
    --text-main: #ffffff;
    --text-muted: #a39a95;
    --border-glass: rgba(255, 255, 255, 0.08);
    --shadow-float: 0 15px 35px rgba(0, 0, 0, 0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; user-select: none; -webkit-tap-highlight-color: transparent; }

body { 
    background: radial-gradient(circle at top, #1a110c 0%, var(--bg-app) 100%);
    color: var(--text-main); 
    height: 100vh; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
}

/* --- Cabeçalho --- */
.app-header { text-align: center; padding: 40px 20px 20px; z-index: 10; }
.app-header .logo { font-size: 26px; font-weight: 700; color: var(--primary); margin-bottom: 5px; text-shadow: 0 0 15px var(--primary-glow); }
.app-header p { color: var(--text-muted); font-size: 15px; font-weight: 300; }

/* --- Container da Grade --- */
.grid-container { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; overflow: hidden; display: flex; flex-direction: column; }

.grid-projetos {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px;
    padding: 20px 30px 120px; overflow-y: auto; width: 100%; height: 100%;
}
.grid-projetos::-webkit-scrollbar { width: 4px; }
.grid-projetos::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); }
.grid-projetos::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; box-shadow: 0 0 10px var(--primary-glow); }

/* --- Cartão Flutuante --- */
.floating-card {
    background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 20px; padding: 25px 20px; box-shadow: inset 0 0 20px rgba(255, 102, 0, 0.02), var(--shadow-float);
    text-align: center; border: 1px solid var(--border-glass); border-top: 1px solid rgba(255, 255, 255, 0.15); 
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease; animation: float 6s ease-in-out infinite;
    display: flex; flex-direction: column; justify-content: space-between; height: 300px; box-sizing: border-box;
    -webkit-box-reflect: below 10px linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,0.1) 80%, rgba(0,0,0,0.3) 100%);
}

.floating-card:hover { transform: translateY(-8px); border-color: rgba(255, 102, 0, 0.5); box-shadow: inset 0 0 30px rgba(255, 102, 0, 0.05), 0 20px 40px rgba(255, 102, 0, 0.15); }
.card-top { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.card-bottom { display: flex; flex-direction: column; gap: 15px; margin-top: auto; }
.floating-card .emoji-icon { font-size: 45px; transition: transform 0.3s ease; filter: drop-shadow(0 0 10px rgba(255,255,255,0.2)); }
.floating-card:hover .emoji-icon { transform: scale(1.15) rotate(5deg); }
.floating-card h3 { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--text-main); margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.floating-card .turma { color: var(--text-muted); font-size: 13px; font-weight: 400; margin: 0; letter-spacing: 0.5px; }

.btn-votar-card {
    width: 100%; padding: 14px; border-radius: 12px; border: none; background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white; font-weight: 600; font-size: 15px; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-votar-card:active { transform: scale(0.95); box-shadow: 0 2px 5px var(--primary-glow); }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-6px); } 100% { transform: translateY(0px); } }

/* --- Modal --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); z-index: 100; display: flex; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content { background: #15110f; border-top: 1px solid var(--border-glass); box-shadow: 0 -10px 40px rgba(255, 102, 0, 0.1); width: 100%; border-radius: 30px 30px 0 0; padding: 30px 20px 40px; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1); position: relative; max-height: 90vh; overflow-y: auto; text-align: center; }
.modal-overlay.active .modal-content { transform: translateY(0); }
.btn-fechar { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass); border-radius: 50%; width: 36px; height: 36px; font-size: 24px; cursor: pointer; color: var(--text-muted); transition: 0.3s; }
.btn-fechar:hover { background: rgba(255,255,255,0.1); color: white; }
.destaque-projeto { color: var(--primary); font-weight: 600; margin: 10px 0 25px; font-size: 18px; text-shadow: 0 0 10px var(--primary-glow); }

.cpf-display-box { font-size: 32px; letter-spacing: 3px; padding: 15px; background: #0d0907; border: 1px solid rgba(255, 102, 0, 0.2); border-radius: 12px; margin-bottom: 20px; font-family: 'Orbitron', monospace; color: var(--primary); text-shadow: 0 0 10px var(--primary-glow); min-height: 68px; }
.teclado-virtual { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 350px; margin: 0 auto 20px; }
.key { background: rgba(255,255,255,0.03); border: 1px solid var(--border-glass); border-radius: 12px; padding: 15px; font-size: 24px; font-weight: 500; color: var(--text-main); cursor: pointer; transition: 0.2s; }
.key:active { background: rgba(255, 102, 0, 0.1); border-color: var(--primary); transform: scale(0.95); }
.key.btn-acao { background: rgba(239, 68, 68, 0.1); color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }

.btn-principal { width: 100%; max-width: 350px; padding: 18px; border-radius: 16px; border: none; background: var(--primary); color: white; font-weight: 600; font-size: 18px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0 auto; box-shadow: 0 5px 20px var(--primary-glow); transition: 0.3s; }
.btn-principal:disabled { background: #332b26; color: #665b55; box-shadow: none; cursor: not-allowed; }
.btn-principal.btn-sucesso { background: #10b981; box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4); }

.camera-wrapper { width: 100%; max-width: 300px; height: 300px; margin: 20px auto; border-radius: 50%; overflow: hidden; border: 4px solid var(--primary); box-shadow: 0 0 30px var(--primary-glow); }
#video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

.tela-sucesso { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-app); z-index: 200; display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: 0.5s; }
.tela-sucesso.ativa { opacity: 1; pointer-events: auto; }
.circulo-check { width: 100px; height: 100px; background: #10b981; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: white; font-size: 60px; margin-bottom: 20px; box-shadow: 0 0 40px rgba(16, 185, 129, 0.4); animation: pop 0.5s ease backwards; }

.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: rgba(255, 255, 255, 0.95); color: #1e293b; padding: 15px 25px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 10px; font-weight: 500; animation: slideIn 0.3s ease; border-left: 5px solid var(--primary); }
.toast.error { border-color: #ef4444; color: #ef4444; }
@keyframes slideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.shake { animation: shake 0.4s; border-color: #ef4444 !important; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* --- NOVA: Tela de Bloqueio da Urna --- */
.lock-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-app); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: 0.5s ease;
}
.lock-screen.active { opacity: 1; pointer-events: auto; }
.lock-content {
    background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass); border-radius: 20px;
    padding: 40px 30px; text-align: center; max-width: 400px; width: 90%;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}
.icon-lock { font-size: 60px; color: var(--primary); margin-bottom: 15px; text-shadow: 0 0 15px var(--primary-glow); }
.lock-content h2 { color: white; margin-bottom: 10px; font-size: 24px;}
.lock-content p { color: var(--text-muted); font-size: 14px; margin-bottom: 25px; line-height: 1.5;}
#senha-auditor-input {
    width: 100%; padding: 15px; border-radius: 12px; margin-bottom: 20px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border-glass);
    color: white; font-size: 18px; text-align: center; outline: none; transition: 0.3s;
}
#senha-auditor-input:focus { border-color: var(--primary); box-shadow: 0 0 15px var(--primary-glow); }