/* Estilos del kiosko y de la pagina de registro facial.

   IMPORTANTE: estas paginas se sirven con `web.layout`, que NO carga Bootstrap
   ni FontAwesome. Cualquier clase de utilidad (d-none, btn, w-100...) que se
   use aqui no hace nada. Por eso se definen las que hacen falta. */

.fc-hidden { display: none !important; }

.fc-btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #28a745;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
}
.fc-btn-block { display: block; width: 100%; }
.fc-center { text-align: center; }
.fc-mt { margin-top: 0.8rem; }

.kiosk-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #fff;
}

.k-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.k-header h1 { font-size: 1.3rem; font-weight: 700; margin: 0; }
.k-clock { font-size: 2.2rem; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.k-date { font-size: 0.85rem; opacity: 0.6; text-align: right; }

.k-body {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 1rem 1.5rem;
    gap: 1.5rem;
    min-height: 0;
}

.k-cam-section { flex: 1; max-width: 760px; display: flex; flex-direction: column; }
.k-cam-wrap {
    position: relative;
    flex: 1;
    min-height: 320px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
}
.k-cam-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scaleX(-1);
}
.k-cam-wrap canvas.overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: scaleX(-1);
}
canvas.hidden-canvas { display: none; }

/* Reposo: solo el boton, con la camara apagada. */
.k-idle {
    flex: 1;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(255, 255, 255, 0.15);
}
.k-mark-btn {
    font-size: 1.8rem;
    font-weight: 700;
    padding: 1.5rem 3rem;
    border-radius: 18px;
    border: none;
    color: #fff;
    background: #28a745;
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.4);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.k-mark-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(40, 167, 69, 0.5); }
.k-mark-btn:active { transform: translateY(0); }
.k-idle p { margin-top: 1.2rem; opacity: 0.6; }

.k-status {
    margin-top: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    text-align: center;
    font-size: 1rem;
    transition: all 0.3s;
}
.k-status.scanning { background: rgba(102, 126, 234, 0.2); border: 1px solid rgba(102, 126, 234, 0.3); }
.k-status.detecting { background: rgba(40, 167, 69, 0.2); border: 1px solid rgba(40, 167, 69, 0.4); }
.k-status.processing { background: rgba(255, 193, 7, 0.2); border: 1px solid rgba(255, 193, 7, 0.3); }
.k-status.success { background: rgba(40, 167, 69, 0.35); border: 1px solid rgba(40, 167, 69, 0.6); font-weight: 600; }
.k-status.error { background: rgba(220, 53, 69, 0.2); border: 1px solid rgba(220, 53, 69, 0.35); }

.k-result-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    transform: translateY(100%);
    transition: transform 0.4s ease;
}
.k-result-banner.show { transform: translateY(0); }
.k-result-name { font-size: 2rem; font-weight: 800; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.k-result-action {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.3rem 1.5rem;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}
.k-result-action.check_in { background: rgba(40, 167, 69, 0.5); border: 1px solid #28a745; }
.k-result-action.check_out { background: rgba(255, 193, 7, 0.4); border: 1px solid #ffc107; color: #ffc107; }
.k-result-conf { font-size: 0.8rem; opacity: 0.5; margin-top: 0.3rem; }

.k-entries {
    width: 300px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}
.k-entries h3 { font-size: 0.95rem; opacity: 0.6; margin-bottom: 0.8rem; font-weight: 600; }
.k-entries-list { flex: 1; overflow-y: auto; }
.e-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.5rem;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    background: rgba(255, 255, 255, 0.03);
}
.e-item.fresh { animation: eSlide 0.4s ease; }
@keyframes eSlide {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.e-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.e-icon.in { background: rgba(40, 167, 69, 0.25); color: #28a745; }
.e-icon.out { background: rgba(255, 193, 7, 0.25); color: #ffc107; }
.e-name { font-weight: 600; font-size: 0.85rem; }
.e-time { font-size: 0.75rem; opacity: 0.45; }
.e-empty { opacity: 0.3; text-align: center; padding: 2rem 0; }

.k-footer {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.3;
    background: rgba(0, 0, 0, 0.2);
}

/* Pagina de registro facial */
.enroll-pose {
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    margin: 0.8rem 0 0.2rem;
}
.enroll-progress { text-align: center; opacity: 0.6; margin-bottom: 0.6rem; }
.enroll-log { max-height: 40vh; overflow-y: auto; font-size: 0.85rem; }
.enroll-log-line { padding: 0.45rem 0.6rem; border-radius: 6px; margin-bottom: 0.35rem; }
.enroll-log-line.ok { background: rgba(40, 167, 69, 0.18); }
.enroll-log-line.ko { background: rgba(220, 53, 69, 0.18); }

@media (max-width: 900px) {
    .k-body { flex-direction: column; }
    .k-entries { width: 100%; max-height: 28vh; }
}

/* Confirmacion de identidad antes de registrar */
.fc-confirm {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
.fc-confirm-label { font-size: 1.1rem; opacity: 0.6; }
.fc-confirm-name {
    font-size: 3rem;
    font-weight: 800;
    margin: 0.5rem 0 1.5rem;
    color: #ffc107;
}
.fc-confirm-warn { max-width: 620px; margin: 1.2rem auto 0; opacity: 0.75; }
.fc-link { color: #9aa8ff; }
